Computer Science, asked by sahildas9021, 7 months ago

Describe the purpose of compareTo(). Write down the return datatype pf the function. ​

Answers

Answered by kanak6544
3

Compare to () method compar two string lexicographically ... The result is a positives integrs if the string object lexicographically follows the argumet string . The result is zero if the strings are equal , compare To retures 0 exactly when the equals (objects) method would return true.

plzzz follow me

Answered by Oreki
0

The method compairTo( ) is used to lexicographically check two Strings where the Unicode differs.

The return type of the method is int.

Similar questions