Short hashCode() method in Java with Examples
The hashCode() method of Short class is a built in method in Java which is used to return the hash code of the ShortObject.
Note: The hashCode() returns the same value as intValue().
Return Value: It return an int value which represents the hashcode of the specified Short object.
Below is the implementation of hashCode() method in Java:
HashCode of 74 : 74
HashCode of -17 : -17
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.