Java EnumMap remove() methodThe remove() method of Java EnumMap class is used to remove the mapping for the given key from EnumMap if the given key is present. SyntaxParameterskey - the key whose mapping is to be removed from the map. ReturnsThis method returns the old value associated with the given key or null if there was no mapping for the given key. ExceptionNA Example 1Output: Map: {Java=1, CSS=2, Python=3, Android=4} Updated Map: {Java=1, Python=3, Android=4} Example 2Output: Map: {Monday=1, Tuesday=2, Wednesday=3} Updated Map: {Monday=1, Tuesday=2, Wednesday=3} Next TopicJava-enummap-size-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