string 1 lexicographically greater than string 2 in java code example Example: lexicographically greater string java s1.compareTo(s4)