"Weak reference objects, which do not prevent their referents from being made finalizable, finalized, and then reclaimed."
These are all stages in the Garbage Collection process. Objects first get marked as finalizable to say that there are no strong references to them. Then finalize() is called and they are marked as finalized, and then finally the memory is reclaimed.
public void clear(): "This method is invoked only by Java code; when the garbage collector clears references it does so directly, without invoking this method."
This is saying that when you as a programmer decide to clear a reference then the clear()
method is used to do that, however if you were to subclass WeakReference
and override the clear
method you would NOT see the JVM calling that method when the object was removed.
The quote for enqueue
is essentially saying the same thing. It is a warning that you cannot interact with the workings of the GC by overriding these methods.