What is the need for overriding equals () method in Java?

Why we override equals() method? It needs to be overridden if we want to check the objects based on the property . For example, we want to check the equality of employee object by the id. Then, we need to override the equals() method.

Sizin İçin Seçtik  Pazarlama denetimi nedir?

Leave a Reply

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