A quote from the book I\'m reading Head First Java:
The point is that hashcodes can be the same without necessarily guaranteeing that the objects are
The hashCode() value can be used to quickly find an object by using the hash code as an address to a hash table bucket where it is stored.
If multiple objects return the same value from hashCode(), it means that they would be stored in the same bucket. If many objects are stored in the same bucket it means that on average it requires more comparison operations to look up a given object.
Instead use equals() to compare two objects to see whether they are semantically equal.