Java EnumMap clear() methodThe clear() method of Java EnumMap class is used to clear all the mapping from the map. This method does not remove the map instead it just removes all the entry from the map. SyntaxParametersNA ReturnsThis method does not return any value. ExceptionNA Example 1Output: Values in map before removing: {Java=1, Python=2, PHP=3, Android=4, AngularJS=5} Values in map after removing: {} Example 2Output: Values in map before removing: {Monday=1, Tuesday=2, Wednesday=3, Thursday=4} Values in map after removing: {} Next TopicJava-enummap-clone-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