Although it would be preferable if unequal objects produce unequal hashcodes there are not always enough hashcode values to allow for one unique hashcode for each unique object value. The Hashcode method returns a value of type int. The set of unique values for the set of Long objects greatly exceeds the number of values of type int. For that reason, many objects of type Long that are not equal must share a single hashcode value.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>