Javatpoint Logo
Javatpoint Logo

Java ConcurrentHashMap elements() Method

The elements() method of ConcurrentHashMap class returns an enumeration of the values in this table.

Syntax

Parameter

No parameter is passed.

Returns

an enumeration of the values in this table

Throws

NullPointerException

Example 1

Test it Now

Output:

The Map is: {20=Cpython, 40=Ec++, 10=Ajava, 30=Dc}
The values are:
Cpython
Ec++
Ajava
Dc

Example 2

Test it Now

Output:

The Map is: {AA=1java, BB=2.net, CC=3python, DD=4c, EE=5c++}
The values are:
1java
2.net
3python
4c
5c++





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA