A WeakHashMap interface extends AbstractMap and implements Map. It is a hashtable-based Map implementation with weak keys. An entry in a WeakHashMap will automatically be removed when its key is no longer in ordinary use. When a key has been discarded its entry is effectively removed from the map, so this class behaves somewhat differently than other Map implementations.
Both null values and the null key are supported. This class has performance characteristics similar to those of the HashMap class, and has the same efficiency parameters of initial capacity and load factor.
Responses to “What is a WeakHashMap?”