Microsoft SDK for Java

getReferent

This method of the WeakReference Class retrieves the current object being tracked.

The returned referent might be in the queue to have its finalizer called. In this case, it is possible to get an object and have that object's finalizer executed. This is possible even though there is a strong reference to that object in a live thread.

Syntax

public Object getReferent();

Return Value

Returns the object being tracked; returns null if the object was collected.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.