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

1 thought on “Choose the correct statement about the IComparer interface in C#?”

  1. 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.

Leave a Comment