Skip to content
Computer ApplicationsICSE Class 9 · Introduction to Object Oriented Programming Concepts

Java Tools, Compilation Process, Bytecode, JVM and Features of Java (ICSE Class 9)

Updated 18 October 2026 · Fact-checked

A Java program is written as source code (.java), translated by the compiler into bytecode (.class) and run by the Java Virtual Machine, which turns bytecode into the machine (object) code of the computer. Because bytecode is machine independent and each system has its own JVM, Java is platform independent. An IDE such as BlueJ combines editor, compiler and debugger; an application runs on its own from main(), while an applet runs inside a browser.

Compile once to bytecode; each system's own JVM turns the same bytecode into its machine code, so Java is platform independent.

Illustration drawn for QuestionBuddy.

Understand Java Tools, Compilation Process, Applets and Features of Java

Open source and tools. Open source software has source code that anyone may use, study, change and share, usually under a licence. OpenJDK is the open source implementation of Java. The JDK (Java Development Kit) has the compiler javac, the runtime java and the class libraries. An IDE (Integrated Development Environment) combines an editor, a compiler, a debugger and tools to run programs; the syllabus names BlueJ, DrJava, NetBeans and MyEclipse. Hardware needed: a computer with enough memory and disk space; software needed: an operating system, a JDK and an IDE.

Application and applet.

  • A Java application is a stand-alone program that runs on the JVM and starts from main().
  • A Java applet is a small program run inside a web page through a browser or applet viewer; it has no main() and works with restricted permissions. Applets are now obsolete and are studied for their role in the history of Java.

Compilation process.
1. Source code: the program as written in Java, saved with the extension .java (for example Welcome.java).
2. Compilation: the compiler javac checks the syntax and translates the source code into bytecode, saved in a .class file.
3. Bytecode: an intermediate, machine-independent code, not meant for any one processor.
4. Execution: the Java Virtual Machine (JVM) loads and checks the bytecode and converts it into object code (machine code) for the computer in use, which the processor executes.
Flow: .java (source) to javac to .class (bytecode) to JVM to machine code to output.

Why Java is platform independent. The compiler produces the same bytecode for every system, and each operating system has its own JVM that understands that bytecode. This is "write once, run anywhere".

Features of Java. Simple, object oriented, platform independent and portable, robust (strong type checking, automatic memory management, exception handling), secure (no explicit pointers; bytecode is verified), multithreaded, high performance (just-in-time compilation) and distributed.

Real-time applications (as examples only). Mobile apps, desktop GUI applications, web-based banking and shopping, games, education applications such as online quizzes and grading systems, chatbots and virtual assistants.

A first program.
class Hello
{
public static void main(String args[])
{
System.out.println("Learning Java");
System.out.println("Compiled to bytecode");
}
}
Output: Learning Java, then Compiled to bytecode on the next line.

Neighbouring topics: the differences between POP and OOP and the four principles are on the previous page of this chapter.

Java Tools, Compilation Process, Applets and Features of Java: key facts

Compilation chain
  • Source code (.java)
  • javac
  • bytecode (.class)
  • JVM
  • object (machine) code
Bytecode is machine independent.
Application versus applet
Application: stand-alone, starts at main(), full access | Applet: runs in a browser, no main(), restricted
Applets are obsolete today.
IDE
Editor + compiler + debugger + run tools in one package | BlueJ, DrJava, NetBeans, MyEclipse
Named in the syllabus.

Java Tools, Compilation Process, Applets and Features of Java in real life

The idea, met in an everyday situation. Answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.

Bytecode and the JVM

Suppose a student writes a quiz program on a Windows laptop and sends the .class file to friends who use Linux and macOS, each with Java installed.

Why can all of them run it without changes?

Try it first, then show the solutionSolution
  1. The .class file holds bytecode, not machine code for Windows.
  2. Each friend has a JVM made for their own operating system.
  3. Each JVM converts the same bytecode into its own machine code.

Answer: The bytecode is machine independent and each JVM translates it for its own system.

Memory hook: Same bytecode, different JVMs.

Compiler as a proofreader

Imagine submitting a handwritten essay that a proofreader checks for spelling mistakes before it is printed.

Which part of Java plays the proofreader?

Try it first, then show the solutionSolution
  1. The proofreader checks before printing.
  2. The compiler javac checks the syntax before the program is run.

Answer: The compiler javac: it reports syntax errors and, only if there are none, produces the bytecode.

Memory hook: Compile checks first, run later.

Tricks to remember Java Tools, Compilation Process, Applets and Features of Java

Short memory aids. Say each one aloud once, then use it on a question the same day.

  • S-B-J-M

    Source, Bytecode, JVM, Machine code.

    Use it when: The compilation process.

  • Applet has no main

    An applet lives in a browser and has no main(); an application starts at main().

    Use it when: Applet versus application.

  • Write once, run anywhere

    One bytecode runs on every JVM.

    Use it when: Platform independence.

Java Tools, Compilation Process, Applets and Features of Java: solved examples

Ordered from board level to HOTS. Try each one before you open the solution.

Example 1: Which file · 1 mark · MCQBoard level

The Java compiler turns Quiz.java into:
(a) Quiz.exe (b) Quiz.class (c) Quiz.obj (d) Quiz.txt

Try it first, then show the solutionSolution
  1. javac produces bytecode, saved as a .class file.

Answer: (b) Quiz.class

Example 2: Assertion and reason · 1 mark · Assertion-reasonHarder board level

Assertion (A): A .class file cannot be run directly by the processor; it needs the JVM.
Reason (R): Bytecode is not the machine code of any particular processor.
(a) Both A and R are true and R is the correct explanation of A. (b) Both A and R are true but R is not the correct explanation of A. (c) A is true but R is false. (d) A is false but R is true.

Try it first, then show the solutionSolution
  1. A is true: the JVM converts bytecode into machine code first.
  2. R is true and explains A, because the processor understands only its own machine code.

Answer: (a) Both A and R are true and R is the correct explanation of A.

Example 3: Who produces what · 3 marks · Short answerHarder board level

For a program Sum, match each item with source code, bytecode or object code, and name what produces it: (i) Sum.java; (ii) Sum.class; (iii) the instructions the laptop's processor finally executes.

Try it first, then show the solutionSolution
  1. (i) Source code, written by the programmer. (1 mark)
  2. (ii) Bytecode, produced by the compiler javac. (1 mark)
  3. (iii) Object (machine) code, produced by the JVM from the bytecode. (1 mark)

Answer: (i) source code, written by the programmer (ii) bytecode, from javac (iii) object code, from the JVM

Example 4: Case study: moving a program · 4 marks · Case-basedHOTS / competency

A student writes Report.java in BlueJ on a school computer and wants to run it on a home laptop that has a different operating system and the JDK installed.
(i) Name the file the compiler produces. (1)
(ii) Name the software that runs it at home and its role. (2)
(iii) Which feature of Java makes this possible? (1)

Try it first, then show the solutionSolution
  1. (i) Report.class containing bytecode.
  2. (ii) The JVM of the home laptop: it loads and checks the bytecode and converts it into the machine code of that laptop.
  3. (iii) Platform independence (write once, run anywhere).

Answer: (i) Report.class (ii) the JVM converts bytecode to machine code (iii) platform independence

Example 5: Application or applet · 3 marks · Short answerHarder board level

Classify each as a Java application or a Java applet and give a reason: (i) a billing program installed on a shop computer that starts from main(); (ii) a small animation that loads inside an old web page; (iii) a program that has full access to the files of the computer.

Try it first, then show the solutionSolution
  1. (i) Application: stand-alone and starts from main(). (1 mark)
  2. (ii) Applet: runs inside a browser or applet viewer and has no main(). (1 mark)
  3. (iii) Application: applets are restricted for safety, applications are not. (1 mark)

Answer: (i) application (ii) applet (iii) application

Where students lose marks in Java Tools, Compilation Process, Applets and Features of Java

The slips examiners see most often, and what to write instead.

  • Mistake: Saying the compiler produces machine code

    Other languages are remembered.

    Wrong working

    javac converts the program into machine code.

    Right working

    javac converts the source code into bytecode; the JVM produces the machine code.

    Do this: Chain: source, bytecode, JVM, machine code.

    Usually costs: 1 mark

  • Mistake: Calling an applet a stand-alone program

    Applets and applications are mixed up.

    Wrong working

    An applet starts from main().

    Right working

    An application starts from main(); an applet has no main().

    Do this: Learn: applet equals browser, no main.

    Usually costs: 1 mark

  • Mistake: Wrong file extensions

    .class and .java are swapped.

    Wrong working

    Source code is saved as .class.

    Right working

    Source code is .java; bytecode is .class.

    Do this: Source is Java, bytecode is class.

    Usually costs: 1 mark

Exam tips

  • Draw the flow .java to javac to .class to JVM to machine code for 2 and 3 mark answers.
  • Write bytecode as machine independent and object code as machine specific.
  • Name at least two IDEs (BlueJ, NetBeans, DrJava, MyEclipse).
  • Do not call applets current technology; say they are obsolete.

Practice questions on Java Tools, Compilation Process, Applets and Features of Java

Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.

  1. Q1 · 1 mark · MCQBoard level

    Which of these is an IDE for Java?
    (a) JVM (b) BlueJ (c) javac (d) bytecode

    Hint

    An IDE has editor, compiler and debugger together.

    Answer

    (b) BlueJ

  2. Q2 · 1 mark · Very short answerBoard level

    Expand JDK and IDE.

    Hint

    Java Development Kit.

    Answer

    JDK: Java Development Kit. IDE: Integrated Development Environment.

  3. Q3 · 2 marks · Short answerHarder board level

    Give the output:

    System.out.print("Java ");
    System.out.println("is ");
    System.out.print("robust");
    Hint

    print keeps the cursor on the line; println moves down.

    Answer

    Java is (the cursor moves to the next line after "is ") then robust on the second line, so the output is:
    Java is
    robust

  4. Q4 · 3 marks · Short answerHarder board level

    Explain why Java is called (i) robust (ii) secure.

    Hint

    Think of type checking and pointers.

    Answer

    (i) Strong type checking, automatic memory management and exception handling make programs reliable. (ii) Java has no explicit pointers and bytecode is verified by the JVM before it runs.

  5. Q5 · 2 marks · Short answerHOTS / competency

    A computer with a new operating system has no JVM installed. Can it run a Java .class file that works on other computers? Give a reason and say what must be installed.

    Hint

    Who converts bytecode to machine code?

    Answer

    No. The bytecode cannot be executed until a JVM made for that operating system converts it into the machine code of the computer. A JVM (for example as part of a JDK) must be installed.

Test your recall

Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.

  1. 1.Extension of a Java source file?Show answer

    .java

  2. 2.Extension of the compiled file?Show answer

    .class

  3. 3.What does the JVM convert bytecode into?Show answer

    Machine (object) code.

  4. 4.Name the open source implementation of Java.Show answer

    OpenJDK

  5. 5.Which program type has no main()?Show answer

    An applet.

  6. 6.Name the Java compiler.Show answer

    javac

Java Tools, Compilation Process, Applets and Features of Java: frequently asked questions

Do I need to write applets in ICSE?

No. You only define applets and compare them with applications.

Is bytecode the same as machine code?

No. Bytecode is machine independent; machine code is specific to one processor and is made by the JVM.

Why is BlueJ used in schools?

It is free and designed for learning; it shows classes and lets students create objects and call methods interactively.