Choose the correct statement about the IComparer interface in C#?

Choose the correct statement about the IComparer interface in C#?
A. The IComparer interface is in System.Collections
B. It defines a method called Compare(), which compares the values of two objects
C. Both The IComparer interface is in System.Collections & It defines a method called Compare(), which compares the values of two objects
D. None of the mentioned
 
Answer: c
Explanation: The IComparer interface is in System.Collections. It defines a method called Compare(), which compares the values of two objects. It is shown here: int Compare(object x, object y). It returns greater than zero if x is greater than y, less than zero if x is less than y, and zero if the two values are equal.
 

Tìm kiếm

Back
Top