80
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
Output:
Mappings are: {python=20, c++=30, java=10, c=25, .net=15} is java present? :: true
Example 2
Output:
Mappings are: {python=20, c++=30, java=10, c=25, .net=15} is javascript present? :: false
Next TopicJava ConcurrentHashMap