Example & Tutorial understanding programming in easy ways.

Why we override equals() method in java?

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

Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!