to compare two string lexicographically in javav code example Example: lexicographically greater string java s1.compareTo(s4)