Clear the map

suggest change
Map<Integer, String> map = new HashMap<>();

map.put(1, "First element.");
map.put(2, "Second element.");
map.put(3, "Third element.");

map.clear();

System.out.println(map.size());   // => 0

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents