What is the Java Virtual Machine? What purpose does it serve & how does it facilitate program portability?
Solution
Java Virtual Machine is a part of Java Run Environment (JRE). A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode.
Java compiler produce Bytecode for a Java Virtual Machine. Bytecode is an intermediary language between Java source and the host system.
JVM is a specification that provides runtime environment in which java bytecode can be executed. It is the medium which compiles Java code to bytecode which gets interpreted on a different machine and hence it makes it Platform/Operating system independent. Bytecode execution with a JVM makes java a platform independent language.
Get Answers For Free
Most questions answered within 1 hours.