CTCaliberTek
Interview Questions

Top 30 Java Interview Questions and Answers

Commonly asked Java interview questions for entry-level to mid-level roles.

  1. 1. What is the difference between JDK, JRE, and JVM?

    JVM (Java Virtual Machine) executes bytecode. JRE (Java Runtime Environment) bundles the JVM with core libraries needed to run applications. JDK (Java Development Kit) bundles the JRE with development tools like the compiler.

  2. 2. What is the difference between == and .equals() in Java?

    == compares object references (memory addresses) for objects, while .equals() compares logical equality as defined by the class's implementation.

  3. 3. What is the difference between an abstract class and an interface?

    An abstract class can hold state and constructor logic and supports single inheritance. An interface defines a contract that multiple classes can implement, and since Java 8 can include default methods.

  4. 4. What is garbage collection in Java?

    Garbage collection is the automatic process by which the JVM reclaims memory occupied by objects that are no longer reachable from the application.

Interview Tips

  • Practice explaining concepts out loud, not just writing code.
  • Be ready to discuss trade-offs, not just definitions.
  • Have a couple of real projects ready to reference for behavioral follow-ups.