As you can see that the output is not zero, which means that compareTo() method is case sensitive . However we do have a case insensitive compare method in string class, which is compareToIgnoreCase(), this method ignores the case while comparing two strings.