LinkedHashMap: clear()
import java.util.LinkedHashMap;
public class Main {
public static void main(String[] args) {
LinkedHashMap<String,String> lHashMap = new LinkedHashMap<String,String>();
lHashMap.put("1", "One");
lHashMap.put("2", "Two");
lHashMap.put("3", "Three");
lHashMap.clear();
System.out.println(lHashMap.size());
}
}
Related examples in the same category