Search This Blog

Why does String define the equals( ) method? Can’t I just use ==?

The equals( ) method compares the character sequences of two String objects for
equality. Applying the == to two String references simply determines whether the two
references refer to the same object.