The compareTo() function is used to ________________

The compareTo() function is used to ________________ Correct Answer Compare string object to another string object

The source and target must be objects of the string class. The compare is always case sensitive. To compare two string objects without case sensitivity then we can use compareToIgnoreCase() function.

Related Questions

What is the value returned by function compareTo() if the invoking string is less than the string compared?
What is the value returned by the function CompareTo() if the invoking string is less than the string compared?
What is the value returned by function compareTo() if the invoking string is greater than the string compared?
The String method compareTo() returns
Which of these exceptions is thrown by compareTo() method defined in a double wrapper?
In Java, what is the purpose of the `compareTo` method in the Comparable interface?