Used to compare the values of two strings.
If the value returned for this method is ZERO, the strings compared are identical.
If the value returned for this method is NEGATIVE, the string compared to come before the string .
If the value returned for this method is POSITIVE, the string compared to comes after.
There are a number of compareTo style methods including compareToIgnoreCase(). See the Java API for more details.
word.compareTo(otherWord); // yields 0 if word and otherWord are the same.