why use Hash Code? what is difference between Hash Code and Equals?
If for two distinct objects A and B their hashCodes are different the objects A
and B most certainly aren't equal. The other way around if both distinct objects
A and B are equal then their hashCodes must be equal.
The hashCode can quickly determine whether or not two objects are equal:
are the hashCodes different, the objects aren't equal, otherwise the equals()
method must break the tie.
If you want to override the equals() method you must override the hashCode()
method too.
kind regards,
Jos