Determine if two strings are equal by comparing them.
String |
The equals() method compares two strings, returning true if they are equal and false otherwise.
Tip: Utilize the compareTo() method to compare two strings lexicographically.
public boolean equals(Object anotherObject) |
Parameter |
description |
anotherobject |
An object representing the other string to be compared. |
Returns: |
A boolean value:
|
Overrides: |
equals in class Object |