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. In what order do static blocks, instance blocks and constructors run in Java?

    A static block runs once when the class is first loaded. For every new object, instance initialiser blocks and field initialisers run first, in source order, and then the constructor body.

    IntermediateQuick answer1 min read