java.lang.ref
Class PhantomReference
java.lang.Object
|
+--java.lang.ref.Reference
|
+--java.lang.ref.PhantomReference
public class
PhantomReferenceextends
Reference A phantom reference is useful, to get notified, when an object got
finalized. You can't access that object though, since it is
finalized. This is the reason, why get()
always
returns null.
Author:PhantomReference
public PhantomReference(java.lang.Object referent, java.lang.ref.ReferenceQueue q)
Creates a new phantom reference.
Parameters:
Throws:
get
public Object get()
Returns the object, this reference refers to.
Returns:
null
, since the refered object may be
finalized and thus not accessible.
get()
always returns null.