There are four type of references in Java: Strong, Soft, Weak, and phantom. Kindly elaborate where and how Java exactly use phantom reference.
EDIT :
I did read the javaDoc, as assylias posted below. the section says an object is phantom rechable if it has been finalized and some phantom refernce refers to it. I dint quite get that statement.
What is the use of phantom and in which cases shall we use it?
How each type of reference works is described in the
java.lang.refpackage javadoc:There are a few posts on Stack OVerflow that give examples of how and when you might need a
PhantomReference: