All Subjects
Light
AP Computer Science A
The `compareTo()` method is used to compare two strings lexicographically (i.e., based on their alphabetical order). It returns an integer value that indicates the difference between the two strings.
This method compares two strings and returns a boolean value indicating whether they have exactly the same characters in the same order.
charAt(): This method returns the character at a specified index position within a string.
This method returns the number of characters in a string.