The compareTo() method compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings.
The compareTo() method compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings.