Does == compare string?

equals(Object other) function to compare strings, not the == operator . The function checks the actual contents of the string, the == operator checks whether the references to the objects are equal.

Sizin İçin Seçtik  How do you implement equals method in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *