# Uses of Class
java.lang.ref.Cleaner

Packages that use Cleaner
Package
Description
java.lang.ref
Provides reference-object classes, which support a limited degree of interaction with the garbage collector.
jdk.incubator.foreign
Classes to support low-level and efficient foreign memory/function access, directly from Java.

- ## Uses of Cleaner in java.lang.ref

  Methods in java.lang.ref that return Cleaner
  Modifier and Type
  Method
  Description
  `static Cleaner`
  Cleaner.`create()`
  Returns a new `Cleaner`.
  `static Cleaner`
  Cleaner.`create(ThreadFactory threadFactory)`
  Returns a new `Cleaner` using a `Thread` from the `ThreadFactory`.

- ## Uses of Cleaner in jdk.incubator.foreign

  Methods in jdk.incubator.foreign with parameters of type Cleaner
  Modifier and Type
  Method
  Description
  `static ResourceScope`
  ResourceScope.`newConfinedScope(Cleaner cleaner)`
  Create a new confined scope managed by a `Cleaner`.
  `static ResourceScope`
  ResourceScope.`newSharedScope(Cleaner cleaner)`
  Create a new shared scope managed by a `Cleaner`.