Javatpoint Logo
Javatpoint Logo

Java ConcurrentHashMap equals() Method

The elements() method of ConcurrentHashMap class Compares the specified object with this map for equality and returns true if the given object is a map with the same mappings as this map.

Syntax

Parameter

o - object to be compared for equality with this map

Returns

It returns true if the specified object is equal to this map.

Throws

No exception is thrown.

Example 1

Test it Now

Output:

comparing mymap and mymap2 :true

Example 2

Test it Now

Output:

comparing mymap and mymap2 :false





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA