Javatpoint Logo
Javatpoint Logo

Java EnumMap entrySet() method

The entrySet() method of Java EnumMap class is used to create a set of elements contained in the EnumMap.This method returns a set view of this EnumMap.

Syntax

Parameters

NA

Returns

This method returns a set view of the mappings contained in this enum map.

Exception

NA

Example 1

Test it Now

Output:

Map: {CSS=1, Python=2, PHP=3, Java=4}
Set: [CSS=1, Python=2, PHP=3, Java=4]

Example 2

Test it Now

Output:

Map: {Monday=1, Tuesday=2, Wednesday=3, Thursday=4}
Set: [Monday=1, Tuesday=2, Wednesday=3, Thursday=4]
Next TopicJava EnumMap



Please Share

facebook twitter google plus pinterest