Javatpoint Logo
Javatpoint Logo

Java IdentityHashMap keySet() method

The keyset() method of the Java IdentityHashMap class is used to get a set view of all the keys contained in the calling IdentityHashMap.

Syntax

Return

A set containing all the keys contained in the calling IdentityHashMap

Example 1

Test it Now

Output:

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

Example 2

Test it Now

Output:

[1, 3, 2, 4]



Help Others, Please Share

facebook twitter pinterest