Interview Q&A / Java

INTERVIEW Q&A · 72 QUESTIONS

Java interview questions

Collections, the JVM, strings, exceptions and threads, the backbone of most campus placement rounds.

  1. 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