LinkedHashMap: clear() : LinkedHashMap « java.util « Java by API






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

1.new LinkedHashMap()
2.new LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder)
3.LinkedHashMap: containsKey(Object key)
4.LinkedHashMap: containsValue(Object value)
5.LinkedHashMap: get(Object key)
6.LinkedHashMap: put(K key, V value)
7.LinkedHashMap: remove(Object key)
8.LinkedHashMap: size()
9.LinkedHashMap: values()