WeakHashMap is an implementation of the Map interface that stores only weak references to its keys. Storing only weak references allows a key-value pair to be garbagecollected when its key is no longer referenced outside of the WeakHashMap.
The WeakHashMap class supports four constructors.
WeakHashMapTest CODE import java.util.*; OUTPUT Before: Lahari Latha DESCRIPTION In the above example program we have taken WeakHashMap,we will put entry for the
|