Why Java Is Platform Independent?
There are two tools which is for compliling and running java programs:
javac - it is compiler which converst java source code to byte code ie.class file. This byte code is standard for all platforms, machines or operating systems.
java - this is interpreter. this interprets the .class file based on a particular platform and excutes them.
jvm -> java virtual machine comes into play. jvm for windows will be different from jvm for solarais or linux . but all the jvm take the same byte code and executes them in that platform.
Source code -> javac ->Universal byte code
Universal byte ->jvm/java -> execute them on a particular machine.
There can be any number of jvm's but they all understand the one common language called byte code and translates them into the binary executable of a particular platform for which they are developed. There is separate development section in sun microsystems is to develop the jvm f or a particular platform.
for each upgrade of the jdk , the jvm for each platform is updated.
No comments:
Post a Comment