How does JVM help to achieve platform independence

Questions by bandita

Showing Answers 1 - 1 of 1 Answers

JVM means Java Virtual Machine. Java has been designed in such a way that makes it platform independent and can work on any type of operating system and platform provided JVM is installed in it.

So, consider a system in which JVM is installed.
Java works in the following way..
1)Source code is written
2)Source code is converted into an intermediate format known as byte code by JAVAC(These are not machine instructions but just an intermediate format - format between Java source code and machine instruction). Java byte codes obtained from javac can be executed on any platform and OS provided JVM is installed in it. Byte codes are instructions that the Java virtual machine executes. So, we can say that JVM is platform dependent but Java is platform independent. Once the byte codes are available from JAVAC, it is fed as input to JVM.. Based on the type of platform and OS(which shows that JVM is machine dependent, that is it depends on the OS EX: windows, Linux etc..) , the JVM executes the byte codes.

Finally I would like to conclude by telling that,
Java byte codes are platform independent but Java virtual Machine is platform dependent.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions