Class WeakReference<T extends Serializable>

    • Constructor Detail

      • WeakReference

        public WeakReference​(T referent)
        Creates a new weak reference that refers to the given object. The new reference is not registered with any queue.
        Parameters:
        referent - T; object the new weak reference will refer to
    • Method Detail

      • get

        public final T get()
        Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.
        Specified by:
        get in class Reference<T extends Serializable>
        Returns:
        The object to which this reference refers, or null if this reference object has been cleared.