Javatpoint Logo
Javatpoint Logo

Java EnumMap values() method

The values() method of Java EnumMap class is used to create a collection view of the values contained in this map.

Syntax

Parameters

NA

Returns

This method returns a collection view of the mapped values.

Exception

NA

Example 1

Test it Now

Output:

Map: {Java=1, CSS=2, Python=3, Android=4}
Collection: [1, 2, 3, 4]

Example 2

Test it Now

Output:

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



Please Share

facebook twitter google plus pinterest