public int hashCode() : Returns a hash code value for the object.
- As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects.
- If two object are equal a/c to the equals() method, then calling hashCode() on those object must produce the same hash value.
- It's not mandatory that if hash values of two object are equal, then the two objects should be equal.
It's generally said,
- As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects.
- If two object are equal a/c to the equals() method, then calling hashCode() on those object must produce the same hash value.
- It's not mandatory that if hash values of two object are equal, then the two objects should be equal.
It's generally said,