Java EnumMap equals() methodThe equals() method of Java EnumMap class is used to compare two maps for equality. This method basically compares the passed object with this EnumMap object. SyntaxParameterso - the object to be compared for equality with this map. ReturnsThis method returns true if the specified object is equal to this map. ExceptionNA Example 1Output: Map1:{CSS=1, Python=2, PHP=3, Java=4} Map2:{CSS=1, Python=2, PHP=3, Java=4} Map1 and Map 2 are equal: true Map1 and Map 2 are equal: false Example 2Output: Map1:{Monday=1, Tuesday=2, Wednesday=3} Map2:{Monday=1, Tuesday=2, Wednesday=3} Map1 and Map 2 are equal: true Map1 and Map 2 are equal: false Next TopicJava-enummap-get-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India