equalsnHashcode
equalsnHashcode
Java hashcode()
o A hashcode is an integer value associated with every object in
Java, facilitating the hashing in hash tables.
o To get this hashcode value for an object, we can use the hashcode()
method in Java. It is the means hashcode() method that returns
the integer hashcode value of the given object.
o Since this method is defined in the Object class, hence it is inherited
by user-defined classes also.
o The hashcode() method returns the same hash value when called on
two objects, which are equal according to the equals() method. And
if the objects are unequal, it usually returns different hash values.
Syntax:
Returns:
It returns the hash code value for the given objects.