Home » Java ConcurrentHashMap equals() Method

Java ConcurrentHashMap equals() Method

by Online Tutorials Library

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  

You may also like