Javatpoint Logo
Javatpoint Logo

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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA