Java examples for java.util:Collection Creation
Create new Weak Hash Map
//package com.java2s; import java.util.Map; import java.util.WeakHashMap; public class Main { public static void main(String[] argv) { System.out.println(newWeakHashMap()); }/*from ww w . jav a 2 s . c om*/ public static <K, V> WeakHashMap<K, V> newWeakHashMap() { return new WeakHashMap<K, V>(); } public static <K, V> WeakHashMap<K, V> newWeakHashMap( final int initialCapacity) { return new WeakHashMap<K, V>(initialCapacity); } public static <K, V> WeakHashMap<K, V> newWeakHashMap( final int initialCapacity, final float loadFactor) { return new WeakHashMap<K, V>(initialCapacity, loadFactor); } public static <K, V> WeakHashMap<K, V> newWeakHashMap( final Map<? extends K, ? extends V> m) { return new WeakHashMap<K, V>(m); } }