Interview Q&A / Java
Java interview questions
Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.
Prefer rapid revision? Practise Java short interview answers →
- What are strong, soft, weak and phantom references in Java?
A strong reference prevents collection. A soft reference is cleared only when memory is short, a weak reference is cleared at the next collection once no strong refs remain, and a phantom reference is used to know when an object has been reclaimed.
AdvancedQuick answer1 min read