Lexicographical Comparison

Java-Lexicographical Comparison

Lexicographical Comparison The equals( ) and equalsIgnoreCase( ) methods enable us to check whether two strings are identical or not. However, in some situations, we may wish to test whether one string is greater than, equal to or less than another string. The compareTo( ) method of the String class is useful in all such … Read more…