Javatpoint Logo
Javatpoint Logo

Java IdentityHashMap containsKey() method

The containsKey(Object key) method of the Java IdentityHashMap class is used to check whether the calling IdentityHashMap contains the specified key.

Syntax

Parameters

Key - The possible key which is to be checked in the IdentityHashMap.

Return

True, if the specified key is a key in the calling IdentityHashMap.

Example 1

Test it Now

Output:

true
false
false
true

Example 2

Test it Now

Output:

false
true
true
false



Help Others, Please Share

facebook twitter pinterest