Javatpoint Logo
Javatpoint Logo

Java IdentityHashMap remove() method

The remove(Object key) method of the Java IdentityHashMap class is used remove the linkage of the specified key, from the calling IdentityHashMap, if present.

Syntax

Parameters

key - Key whose linkage is to be removed.

Return

The previous value linked with the specified key, or null if there was no linkage.

Example 1

Test it Now

Output:

{Java=1, the=3, language=6, programming=5, best=4, is=2}
3
4
{Java=1, language=6, programming=5, is=2}

Example 2

Test it Now

Output:




Help Others, Please Share

facebook twitter pinterest