-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ramzi,

On 9/15/2010 12:43 PM, ramzi khlil wrote:
> HashCode is a value computed in such way to be unique as possible to improve
> performance while retrieving object in HashedCollections.

What are HashedCollections?

> If for example you have a HashMap, and didn't overrride hashCode() method
> all your objects will be in the same bucket resulting a slow execution while
> retrieving an object.

Wow. That is so wrong.

> But if you do provide an efficient implementation of hashCode() method your
> objects will be stored across many buckets

This is also not correct.

> and you look up for one of them,
> the api does calculate the hashCode of your object and then it selects the
> right bucket.

Actually, it calls the hashCode method on the object that requires it.
The API performs no calculations. (Technically speaking, the API doesn't
do anything but exist, but let's not pick nits).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyRQ78ACgkQ9CaO5/Lv0PDpkACcDvP2LPw13oXupFptDFRikrDm
YNEAn39YX7/mkXsAu/fOSWsAETNYxAsZ
=igRA
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to