Multiple choiceQuestion 1 · Recall
Loading…
By the end you can show that some programs are partly compiled and partly interpreted, and explain why Java is the standard example.
With ordinary compiled languages, the compiler produces machine code for one processor and operating system.
Java does something different:
.class files.So Java is partly compiled (source to bytecode) and partly interpreted (bytecode executed by the JVM).
.class file runs on any machine that has a JVM. That is the "compile once, run anywhere" idea.The cost: the JVM must be installed on the machine, and it uses memory and adds a small start-up delay.
Worked example: Worked example: tracing a Java program's run
A student writes Hello.java and runs javac Hello.java, then java Hello in the console.
Describe what happens at each stage, and say which parts are compilation and which are interpretation.