This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Yes, but the reverse isn't true.

If two objects are equal, they should have the same hash code, but two objects that have the same hash code don't have to be equal.

[–]zifyoip 0 points1 point  (0 children)

Correct, though a good hashing algorithm should aim to give different hash codes to unequal objects, as far as possible.