The Java.util.EnumMap.entrySet() method in Java used to create a set out of the elements contained in the EnumMap. It basically returns a set view of the enum map.
Syntax:
enum_map.entrySet()
Parameter: The method does not take any parameters.
Return Value: The method returns the set view of mappings contained in this enum_map.
Below programs illustrate the entrySet() method:
Program 1:
Output:
Map view: {India=72, United_States=1083, China=4632, Japan=6797}
Set view of the map: [India=72, United_States=1083, China=4632, Japan=6797]
Program 2: