What is the need of overriding equals method in Java?

When class C overrides the equals method it must check that the object reference passes in is not null, that it is the same class (not a requirement, but typical), and that all the instance data is equal – including all superclass instance variables it inherited.

Sizin İçin Seçtik  Incelemesiz patent belgesi kaç yıl koruma sağlar?

Leave a Reply

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