Javatpoint Logo
Javatpoint Logo

Java ConcurrentHashMap containsKey() Method

The containsKey() method of ConcurrentHashMap class tests if the specified object is a key in this table.

Syntax

Parameter

key - possible key

Returns

true if and only if the specified object is a key 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 java  present? ::  true

Example 2

Test it Now

Output:

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





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