Javatpoint Logo
Javatpoint Logo

Java EnumMap hashCode() method

The hashCode() method of Java EnumMap class is used to get the hashcode value of the EnumMap.This method returns an integer whose value is the sum of the hash codes of each entry in the map.

Syntax

Parameters

NA

Returns

This method returns the hash code value for this map.

Exception

NA

Example 1

Test it Now

Output:

Hash code value of  the map: -450357866
Hash code value after clearing the map: 0

Example 2

Test it Now

Output:

Hash code value of the map: -1315471824
Hash code value after clearing the map: 0
Next TopicJava EnumMap



Please Share

facebook twitter google plus pinterest