Java · Hard
Differentiate between weak references and phantom references.
JavaMemory & JVMJVM
Answer preview
Weak Reference — The object is eligible for GC as soon as no strong references exist. get() returns the object until it's collected, then returns null.…