String s1 = "2" String s2 = "5" s1.compareTo(s2); //returns difference between 2 Strings 3 //returns positive 3 since s2 string is higehr than s1 by 3