Home » Java ConcurrentHashMap contains() Method

Java ConcurrentHashMap contains() Method

by Online Tutorials Library

Java ConcurrentHashMap contains() Method

The contains() method of ConcurrentHashMap class tests if some key maps into the specified value in this table.

Syntax

Parameter

value – a value to search for.

Returns

true if some key maps to the value argument in this table as determined by the equals method; false otherwise

Throws

NullPointerException

Example 1

Test it Now

Output:

Mappings are: {python=20, c++=30, java=10, c=25, .net=15}  is c  present? ::  true  

Example 2

Test it Now

Output:

Mappings are: {Delhi=100, Keral=400, Noida=200, Mumbai=300}  is c  present? ::  false  

You may also like