| Author |
Using the equals and Hashcode methods of an Object?
|
PavanPL KalyanK
Ranch Hand
Joined: Feb 28, 2009
Posts: 212
|
|
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
Joined: Jun 24, 2003
Posts: 3268
|
|
|
It can be used by your code directly and also in other areas such as the Comparators and searching for objects in Lists etc.
|
Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
|
 |
 |
|
|
subject: Using the equals and Hashcode methods of an Object?
|
|
|