VOOZH about

URL: https://www.geeksforgeeks.org/java/enummap-entryset-method-in-java/

⇱ EnumMap entrySet() Method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

EnumMap entrySet() Method in Java

Last Updated : 24 Jul, 2020
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:
Output:
Mapping view: {Global_2018=800, India_2018=72}
Set view of the map: [Global_2018=800, India_2018=72]
Comment