Java AbstractMap.clear()

Java AbstractMap.clear() is a method in the Java AbstractMap class that removes all mappings from the map, leaving it empty. It is used to reset the map for reuse without creating a new instance. Introduced in Java 1995 with Java 1.2, clear() is commonly employed in applications where dynamic data structures need frequent reinitialization.

https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html