Java EnumMap remove() methodLast Updated : 17 Mar 2025 The 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 request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India