The .equals(String string) method is used to compare two strings for equality. It checks if both strings have exactly the same characters in the same order.
Related terms
.compareTo(String string): This method compares two strings lexicographically and returns an integer value based on the comparison result.
.startsWith(String prefix): This method checks if a string starts with a specified prefix.
.endsWith(String suffix): This method checks if a string ends with a specified suffix.