Mega Code Archive

 
Categories / Java Tutorial / Collections
 

WeakHashMap Class

If the Java memory manager no longer has a strong reference to the object specified as a key, then the entry in the map will be removed. Creating a WeakHashMap: The four constructors of WeakHashMap are the same as HashMap public WeakHashMap() public WeakHashMap(int initialCapacity) public WeakHashMap(int initialCapacity, float loadFactor) public WeakHashMap(Map map)