What is the reason for overriding equals () method?

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  Squid Game kaç milyar?

Leave a Reply

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