133
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
Output:
The Map is: {20=Cpython, 40=Ec++, 10=Ajava, 30=Dc} The values are: Cpython Ec++ Ajava Dc
Example 2
Output:
The Map is: {AA=1java, BB=2.net, CC=3python, DD=4c, EE=5c++} The values are: 1java 2.net 3python 4c 5c++
Next TopicJava ConcurrentHashMap