Arun Giridharan wrote:
The hashCode() must convert the Address into Integer of respective object it searched and return Int ...right.
Mixing two topics?
OK, hashCode() method is used to differentiate two object with equlas() method. If you don't override the hashCode() method in your class, then the default hashCode() will be inherited from the base Object class, that will bring the memory address of the object. In your class(Well, not exactly
), you override the hashCode() method to give
10 for every object of that class.