Open In App

EnumMap values() Method in Java

Last Updated : 13 Jul, 2018
Comments
Improve
Suggest changes
Like Article
Like
Report
The Java.util.EnumMap.values() method in Java is used to create a collection out of the values of the map. It basically returns a Collection view of the values in the EnumMap. Syntax:
EnumMap.values()
Parameters: The method does not take any argument. Return Values: The method returns the collection view of the mapped values. Below programs illustrate the working of Java.util.EnumMap.values() function: Program 1:
Output:
The EnumMap: {India_today=69, United_States_today=1073}
Collection view of map: [69, 1073]
Program 2:
Output:
The EnumMap: {India_today=69, United_States_today=1073, Canada_today=1837}
Collection view of map: [69, 1073, 1837]

Next Article

Similar Reads