What equals () method must you override when defining a class of objects?

The String class overrides the equals method it inherited from the Object class and implemented logic to compare the two String objects character by character. The reason the equals method in the Object class does reference equality is because it does not know how to do anything else.

Sizin İçin Seçtik  What is equals method in Object class Java?

Leave a Reply

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