Using hashcode
1 posts in topic
Flat View  Flat View

Posted By:   Anson_Ng
Posted On:   Friday, September 27, 2002 08:39 AM

Hi, according to the objective section 9 of scjp1.4, we have to distinguish between correct and incorrect implementations of hashcode methods.
I only know hashcode() will return an identity number for each object to make searching more efficient through the hashtable.
Howeven, i know nothing about how it is implemented. Could anyone give me further information on this topic. Thank you.

Re: Using hashcode

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, September 27, 2002 09:25 AM

"Correct" just means it obeys the "contract" in the java.lang.Object specification (looking this up is an exercise left for the reader, either in Sun's doc or e.g. in Josh Bloch's "Effective Java" book on p. 36, item 8).

About | Sitemap | Contact