Skip to content
Ameen Abozaid
Planned lessonMID-001-L01

From .class file to running code

  • Lesson 1 of 6
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

trace a Java source file through compilation to execution.

Planned topics

  • javac turns .java into .class files holding bytecode, a portable instruction set.
  • The JVM loads classes on demand, verifies them, then runs the bytecode.
  • Bytecode is not machine code; the JVM interprets it, then compiles hot parts to machine code.
  • "Write once, run anywhere" works because the JVM, not your code, is platform-specific.
Draft outline details

Demonstration

text
Shop.java --javac--> Shop.class --JVM: load, link, init--> interpret / JIT --> CPU

Check your understanding

What does javac produce?

Show answer

Bytecode in .class files, not machine code.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.