Online Java compareTo() function

compareTo - Compares two strings lexicographically


Run on Java version: