Module java.base
Package java.lang.ref

# Class Reference

≠
public abstract sealed class Reference<T>
extends java.lang.Object
permits java.lang.ref.FinalReference<T>, java.lang.ref.PhantomReference<T>, java.lang.ref.SoftReference<T>, java.lang.ref.WeakReference<T>
Comparing jdk-master and valhalla-csr-open

Type Parameters:
  `T` - the type of the referent

Direct Known Subclasses:
  `PhantomReference, SoftReference, WeakReference`

public abstract sealed class Reference<T> extends Object permits PhantomReference<T>, SoftReference<T>, WeakReference<T> (not exhaustive)
Abstract base class for reference objects. This class defines the operations common to all reference objects. Because reference objects are implemented in close cooperation with the garbage collector, this class may not be subclassed directly.
Moved to a division with class preview-block.
The referent must have object identityPREVIEW . When preview features are enabled, attempts to create a reference to a value objectPREVIEW result in an `IdentityException` PREVIEW .

Sealed Class Hierarchy Graph:
Since:
  1.2

## Methods

- =
  public void clear()
- =
  protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
- =
  public boolean enqueue()
- =
  public T get()
- =
  @Deprecated(since="16")
  public boolean isEnqueued()
- =
  public static void reachabilityFence(java.lang.Object arg0)
- =
  public final boolean refersTo(T arg0)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
Reference |  |  |  |  |  |  |  | 1 |  | 1
Total |  |  |  |  |  |  |  | 1 |  | 1