The hashCode()  method of Java Integer class returns a hash code for this Integer. 

Syntax

  1. public int hashCode()
  2. public static int hashCode(int value) 

Parameters

The parameter ‘value’ represents a value whose hash code is to be determined.

Overrides

The hashCode() method overrides hashCode in class Object.

Return Value

This method returns a hash Code value for this Integer.

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This