what is virtual machine

3rd Jul 2016, 4:28 AM
Dev Anand
2 Answers
+ 1
The Java Virtual machine (JVM) is the virtual machine that run the Java bytecodes. The JVM doesn't understand Java source code, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM. It's also the entity that allows Java to be a "portable language" (write once, run anywhere). Indeed there are specific implementations of the JVM for different systems (Windows, Linux, MacOS, etc ), the aim is that with the same bytecodes they all give the same results.
3rd Jul 2016, 1:40 PM
Prince Avi
Prince Avi - avatar
- 1
JVM doesn't understand what you have written it only understand bytecodes. whenever you compile the .Java file automatically a .class file is generated which you can run on any computer like Mac or Windows everywhere that's why it is called wora ( write once run anywhere).
3rd Jul 2016, 1:44 PM
Prince Avi
Prince Avi - avatar