Javatpoint Logo
Javatpoint Logo

Java IdentityHashMap size() method

The size() method of the Java IdentityHashMap class is used to calculate the no of key-value pairs present in the calling IdentityHashMap.

Syntax

Return

An integer denoting the number of key-value pairs present in the IdentityHashMap.

Example 1

Test it Now

Output:

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

Example 2

Test it Now

Output:

4
{1=Student@70dea4e, 3=Student@5c647e05, 2=Student@33909752, 4=Student@55f96302}



Help Others, Please Share

facebook twitter pinterest