Shouldn't it be false as hashcode is not overidden.
Sebastian Janisch
Ranch Hand
Joined: Feb 23, 2009
Posts: 1183
posted
0
No ... hashCode becomes important when working with collections to determine lookup locations for objects.
In collections, the hashCode determines the location to look for the object, then equals determines equality. Which also means two identical hashCode do not necessarily mean equality. The opposite however is true. Two equal objects must have the same hashCode.
JDBCSupport - An easy to use, light-weight JDBC framework -
Harsh Pensi
Ranch Hand
Joined: Aug 05, 2009
Posts: 67
posted
0
Hi Shivani
I failed to understand why you need hashcode here hashcode method has to be overridden if you want to be able to use the class properly in a collection that uses hashing.