What is JVM (Java Virtual Machine)
Table of Content:
What is JVM (Java Virtual Machine)
The Java language is a high-level language. All language compilers translate source code into machine code.
Java compiler does the same thing.You save a Java program in a .java
file and compile it into a .class
file. The .class
file (also called bytecode).
Output of a Java compiler is not executable code. Rather, it is bytecode. Bytecode is a highly optimized set
of instructions designed to be executed by the Java run-time system, which is called the Java Virtual
Machine (JVM).The bytecode is similar to machine instructions but is architecture neutral and can run
on any platform that has a Java Virtual Machine (JVM).The JVM executes our code along with the code in the library.
To execute a Java program is to run the program’s bytecode or .class
file.
You can execute the bytecode
on any platform with a JVM, which is an interpreter . the original JVM was designed as
an interpreter for bytecode. It translates the individual instructions in the bytecode into the target
machine language code one at a time rather than the whole program as a single unit.
Each step is executed immediately after it is translated.