All the strings in the lists are compared, using the String.compareTo method, and the maximum value is returned.