in Technology by
Why we override equals() method?

1 Answer

0 votes
by
The equals method is used to check whether two objects are the same or not. It needs to be overridden if we want to check the objects based on the property. For example, Employee is a class that has 3 data members: id, name, and salary. However, we want to check the equality of employee object by the salary. Then, we need to override the equals() method.

Related questions

0 votes
    Why is it important to override GetHashCode when Equals method is overridden?...
asked Jan 16, 2021 in Technology by JackTerrance
0 votes
    How can we override the default properties of Spring boot projects?...
asked Jul 23, 2021 in Technology by JackTerrance
0 votes
    Can we override the static methods?...
asked Nov 19, 2020 in Education by Editorial Staff
0 votes
    Why is it that in some cases, SQL override is used?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    I can't explain this error in the game I am trying to make. I'm pretty new to game programming, ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I can't explain this error in the game I am trying to make. I'm pretty new to game programming, ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    What is the difference between equals() and method and == operator? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    How to override or replace the Embedded tomcat server in Spring Boot?...
asked Jul 7, 2021 in Technology by JackTerrance
0 votes
    What do you understand by Dictionary Override?...
asked May 24, 2021 in Technology by JackTerrance
0 votes
    State the differences between SQL Override and Lookup Override?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    What are the different transformations where you can use a SQL override?...
asked Mar 27, 2021 in Technology by JackTerrance
0 votes
    When do you use SQL override in a lookup transformation?...
asked Mar 26, 2021 in Technology by JackTerrance
0 votes
    How Do You Override a Spring Boot Project’s Default Properties?...
asked Nov 15, 2020 in Technology by Editorial Staff
0 votes
    I've noticed on Marshmallow (e.g. Nexus 6P) and also on some more recently updated Lollipop phones ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
...