Back to the 2026 paper

Module 1: Introduction to Java

20267m

A Java program is required to run on different operating systems without recompilation of the source code. Analyse the role of bytecode, JVM and JDK in achieving Java's platform-independent execution model.

Worked SolutionAI Assisted

Bytecode, JVM and JDK

  1. Source: The programmer writes .java files.
  2. Compiler: javac (part of the JDK) compiles source into bytecode in .class files.
  3. JVM: A platform-specific JVM loads, verifies and executes bytecode, interpreting it or compiling hot code with a JIT compiler.
  4. JDK: The Java Development Kit contains development tools such as javac, runtime components and debugging/documentation tools. The JVM is the execution engine, not the compiler.
MermaidDiagram
Rendering diagram…

Thus Java source generally need not be recompiled for each OS, provided a compatible JVM and required libraries are available.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.