2011-10-11

How Java achieved Platform Independency ?

Java achieved platform independency by moving machine language generation from compilation phase to execution phase by introducing byte codes and JVM. To support platform independency the program must execute in another operating system means that program must has machine language specific to the client computer OS. The client computer OS is only come to know only when program is downloaded and is being executed. So SUN moved machine language generation to execution phase.Below diagram shows Java's platform independency diagram.



Below is the another block diagram shows Java's platform independency.



From the above diagram we can conclude below points
1) In Java, compiler is Java specific not OS specific as it takes Java source code as input and generates Java byte codes as output.
2) But JVM is OS specific because it takes Java bytecodes and generates OS dependent Machine language.
3) Since JVM is OS dependent,Java software is also OS dependent because Java software means compiler + JVM.
4) But Java program is platform independent. Both because of JVM implementation


Comment for any doubts.....

Loading

Enter your Email here: