Home » Java ConcurrentHashMap entrySet() Method

Java ConcurrentHashMap entrySet() Method

by Online Tutorials Library

Java ConcurrentHashMap entrySet() Method

The entrySet() method of ConcurrentHashMap class returns a Set view of the mappings contained in this map. The changes made to the map are reflected in the set, and vice-versa.

Syntax

Parameter

No parameter is passed.

Returns

the set view

Throws

No exception is passed.

Example 1

Test it Now

Output:

myset values: [AA=Java, BB=angular, CC=JavaScript]  

Example 2

Test it Now

Output:

[1=101, 2=102, 3=103, 4=104, 5=105, 6=106]  

You may also like