| Lesson Plan |
| Grade: |
Date: 25/02/2026 |
| Subject: Computer Science |
| Lesson Topic: Show awareness that high-level language programs may be partially compiled and partially interpreted, such as Java (console mode) |
Learning Objective/s:
- Describe the roles of compilers, interpreters, and hybrid translators.
- Explain how Java’s bytecode, JVM loading, and JIT compilation create a hybrid execution model.
- Compare the performance and portability trade‑offs of pure compilation, pure interpretation, and hybrid approaches.
- Apply the Java console workflow to compile and run a simple program.
- Analyse why Java programs may run faster after a warm‑up period.
|
Materials Needed:
- Projector or interactive whiteboard
- Laptop with Java JDK installed for each student or pair
- Sample Java source file (MyProgram.java) and prepared .class files
- Worksheet with comparison table and short coding tasks
- Access to an online IDE (optional) for quick testing
- Printed diagram of the Java execution flow
|
Introduction:
Begin with a quick poll: “When you run a program, do you think it’s compiled or interpreted?” Connect to prior learning on compilers and interpreters, then state that today’s success criteria are to identify the hybrid nature of Java’s console execution and to compare translation strategies.
|
Lesson Structure:
- Do‑now (5’) – Students list differences between compilers and interpreters on sticky notes; teacher collects key points.
- Mini‑lecture (10’) – Review compiler, interpreter, and hybrid concepts; introduce Java bytecode and JIT.
- Guided demonstration (15’) – Live demo of compiling MyProgram.java, running it, and showing JIT compilation using
-XX:+PrintCompilation.
- Collaborative activity (15’) – Pairs complete a worksheet comparing pure compilation, interpretation, and hybrid, filling the provided table.
- Coding practice (10’) – Students modify a simple loop in MyProgram.java, re‑run, and observe warm‑up performance.
- Check for understanding (5’) – Exit ticket: “In one sentence, describe how Java executes a console program.”
|
Conclusion:
Summarise that Java’s console mode uses a hybrid model where bytecode is interpreted until hot spots are JIT‑compiled, giving both portability and speed. Ask students to write an exit ticket noting one advantage of this approach. For homework, they should research another language that uses a similar hybrid strategy (e.g., C# or Python).
|