Java compareTo Method
Java compareTo Method The Java compareTo() method compares values lexicographically and returns an integer value that describes if the first string is less than, equal to, or greater than the second string. Suppose str1 and str2 are two string variables. str1 == str2 :0 str1 > str2 : positive value str1 < str2 : negative […]