+ 5
java string compareTo() method compares the given string with current string lexicographically. It returns positive number, negative number or 0. It compares strings on the basis of Unicode value of each character in the strings. If first string is lexicographically greater than second string, it returns positive number (difference of character value). If first string is less than second string lexicographically, it returns negative number and if first string is lexicographically equal to second string, it returns 0. if s1 > s2, it returns positive number   if s1 < s2, it returns negative number   if s1 == s2, it returns 0  
21st Mar 2018, 1:20 PM
Manorama
Manorama - avatar