Home » Java ConcurrentHashMap newKeySet() Method

Java ConcurrentHashMap newKeySet() Method

by Online Tutorials Library

Java ConcurrentHashMap newKeySet() Method

The newKeySet() method of ConcurrentHashMap class Creates a new set backed by a ConcurrentHashMap from the given type to Boolean.TRUE.

Syntax

Parameter

No parameter is passed.

Returns

the new set

Throws

No exception is thrown.

Example 1

Test it Now

Output:

Mappings : [AA, CCC, BBB, DDD]  

Example 2

Test it Now

Output:

Mappings : [AA, CCC, BBB, DDD]   Mapping size : 4  

You may also like