• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using the equals and Hashcode methods of an Object?  RSS feed

 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I have an Employee Object with Age and Name as parameters , i had generated equals and hashcode methods for this Object to avoid duplicates.

Can anybody please tell me where these two methods will be useful actually ??

what i think is that while doing (rs.next()) on to DAO layer and setting the Bean in a List , or am i wrong will this be used somewhere else ?? Please tell me .
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be used by your code directly and also in other areas such as the Comparators and searching for objects in Lists etc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!