Skip to main content
InterviewHubPRO
Section Overview
Q1

Question 1 of 50

Part 1: Core Language, Memory Model & Collections (1 - 10)

2%
Java Core & JVM (50 Qs)•Part 1: Core Language, Memory Model & Collections (1 - 10)

What are the key differences between the JVM, JRE, and JDK, and what happens during Java bytecode execution?

junior LevelCode ExamplejavaCore Language

In Simple Words:

  • JDK (Java Development Kit): The complete developer SDK containing compiler (javac), debugger, monitoring tools (jcmd, jconsole), and the JRE.
  • JRE (Java Runtime Environment): The runtime libraries and the JVM needed to run compiled Java applications.
  • JVM (Java Virtual Machine): The abstract computing machine that loads .class bytecode files, verifies them, compiles hot execution paths into native machine code via the JIT compiler (Just-In-Time), and executes instructions on the host CPU.
java
// Execution Flow:
// 1. Source code (OrderService.java)
// 2. Compilation: javac OrderService.java -> OrderService.class (Bytecode)
// 3. ClassLoader: Loading -> Linking (Verification, Preparation, Resolution) -> Initialization
// 4. Execution Engine: Interpreter -> JIT Compiler (C1 / C2) -> Native CPU Instructions
public class OrderService {
    public static void main(String[] args) {
        System.out.println("JVM Bytecode executed on OS: " + System.getProperty("os.name"));
    }
}