java.lang.ref
public
class
java.lang.ref.PhantomReference<T>
Implements a phantom reference, which is the weakest of the three types of
references. Once the garbage collector decides that an object obj
is
finalize() method.
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
PhantomReference(T r, ReferenceQueue<? super T> q)
Constructs a new phantom reference and registers it with the given
reference queue. The reference queue may be
null
, but this case
does not make any sense, since the reference will never be enqueued, and
the
get() method always returns
null
.
Parameters
r
| the referent to track |
q
| the queue to register the phantom reference object with |
Public Methods
public
T
get()
Returns
null
. The referent of a phantom reference is not
accessible.