Dec 16, 2008

Important Point about hash code

Important points about hash code
  1. Hash code is used for increasing the performance of large collection of data.
  2. Hash code is not always unique.
  3. Hash code only tell about the bucket to go into, but not how to locate the name once we are in that bucket.
  4. Collection use the hash code value of the object to decide in which bucket / slot the object should land.
  5. If two objects have same hash code value then it is not necessary that they are equal.
  6. Hashing is a two step process firstly search the right bucket using the hash code value, then search for the element in the bucket using equals()

No comments:

Post a Comment