The Artima Developer Community
Sponsored Link

By George, You're Right!



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


By George, You're Right!

Posted by Bill Venners on 16 Sep 1998, 1:19 AM

> Quoting the docs:

> "If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result."

> Otherwise, the object will not work properly as an element of a hashed collection (Set) or as a key in a hashtable.

> See:

> - -- J

Thanks Jody, you found a bug in my idiom. I'll fix it.



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us