Home » Java Short hashCode() method with Examples

Java Short hashCode() method with Examples

by Online Tutorials Library

Java Short hashCode() Method

The hashCode() method of Java Short class. It will return the value of Short object in to hash code.

Syntax

Since java 1.8, it can also be declared as following:

Parameters

X: short value

Return value

It returns hash code value of a short value

Example 1

Test it Now

Output:

Short ' 100 ' value converted into hash code is  =  100   

Example 2

Test it Now

Output:

 Short ' -300 ' value converted into hash code is  =  -300   

Example 3

Test it Now

Output:

Short ' 500 ' value converted into hash code is  =  500   

Example 4

Test it Now

Output:

Short ' -1500 ' value converted into hash code is  =  -1500  

Next TopicJava Short

You may also like