compareTo() definition mistake?

The example works correctly. The compareTo() method is called by a string object and takes another string object as argument. The return value is integer and is difference in Unicode values of characters of respective strings when they are not equal. The value can be -ve, 0 or +ve.

Updated on: 2019-07-30T22:30:22+05:30

246 Views

Advertisements