|
|
Contents |
The Reference Objects API consists of the classes listed below and shown in the class hierarchy diagram on the right.
To explain how to use the Reference Objects API classes in a program and the resulting behavior of the garbage collector, this lesson covers the following topics:
The
java.lang.ref.Referencejava.lang.ref.SoftReferencejava.lang.ref.WeakReferencejava.lang.ref.PhantomReferencejava.lang.ref.ReferenceQueuejava.util.WeakHashMapSoftReference,WeakReference, andPhantomReferenceclasses define three kinds of Reference objects and three strengths of object reachability. From strongest to weakest, the strengths of reachability are the following:
- Strongly reachable
- Softly rechable
- Weakly reachable
- Phantomly reachable
- Unreachable
|
|
Contents |