CompareTo method which is present in the String class is used to check the two strings. It checks each character with the other String and if found equals then returns 0. Else negative value or positi...
CompareTo() method is derived from Comparable interface and is used to find the Ordering of Strings.
equals() method is from java.lang.Object and used for comparing objects.
CompareTo method which is present in the String class is used to check the two strings. It checks each character with the other String and if found equals then returns 0. Else negative value or positi...
CompareTo() method is derived from Comparable interface and is used to find the Ordering of Strings.
equals() method is from java.lang.Object and used for comparing objects.