94
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
Output:
comparing mymap and mymap2 :true
Example 2
Output:
comparing mymap and mymap2 :false
Next TopicJava ConcurrentHashMap