Read the following case study and answer the questions given below by choosing the correct option: Java compilation is different from the compilation of other high-level languages. Other high-level languages use an interpreter or a compiler, but in Java the source code is first compiled to produce an intermediate code called the byte code. This byte code is platform independent and is a highly optimised set of instructions designed to be executed by the Java run-time system called the JVM (Java Virtual Machine). The JVM is a Java interpreter loaded into computer memory as soon as Java is loaded. The JVM is different for different platforms.
JVM is an/a __________ .
Topic: The role of the JVM
Try it
Pick an option and check your answer. The full worked answer is below either way.
Answer
(a) Interpreter.
The passage states it directly: the JVM is a Java interpreter loaded into memory. Its job is to read the bytecode and execute it instruction by instruction on the particular machine. Keep the roles apart: javac is the COMPILER (source to bytecode), the JVM is the INTERPRETER (bytecode to execution), and the bytecode itself is the intermediate code.
Interpreter.