Advanced Java
Q79 / 100

What is a phantom reference in Java?

Correct! Well done.

Incorrect.

The correct answer is B) The weakest reference type; the referent has been finalized and enqueued in a ReferenceQueue but not yet reclaimed

B

Correct Answer

The weakest reference type; the referent has been finalized and enqueued in a ReferenceQueue but not yet reclaimed

Explanation

Phantom references are used for pre-mortem cleanup. PhantomReference.get() always returns null; you detect collection via the ReferenceQueue.

Progress
79/100