Posted by: Pdfprep
Post Date: March 5, 2021
John works as a Software Developer for Blue Well Inc. He wants to create a class named
Class1 and implements the generic IComparable interface.
He writes the following code:
public class Class1 : System.IComparable<Class1>
{
}
However, John needs to compare one object of Class1 with another object.
Which of the following code statement will John include in his application?
A . public int CompareTo(object obj){}
B . public object CompareTo(int obj){}
C . public object CompareTo(Class1 obj){}
D . public int CompareTo(Class1 obj){}
Answer: D
Leave a Reply