When you create a class and want to include the capability to compare its objects so they can use the Array.Sort() or Array.binarySearch() method, you must _________

a.) Include at least one numberic field within the class
b.) Write a CompareTo() method for the class
c.) Be careful not to override the existing IComparable.CompareTo() method
d.) Two of these are true

Respuesta :

Limosa

Answer:

Option B.

Explanation:

It is the String function of the Java Programming Language that is used to replace the string characters from the Unicode value for matching of both the strings are similar, it results 0, otherwise, it results positive or negative number.

So, CompareTo() function is used to match objects of Array.Sort() or Array.binarySearch() function.