how is Java Platform independent ?

Most programming languages use compilers to translate high level program to machine code of the OS in a single step. Machine code is platform dependent.So,once the machine code is generated we cannot port it to a different OS.Therefore, any language that uses just the compiler to compile as well as execute the program is platform dependent.

Java Platform Independent :

In Java, compiler is divided into two different programs as compiler and interpreter.Java uses compiler to translate high level Java code into bytecode, and uses the interpreter(JVM-Java Virtual Machine) to translate bytecode to machine code. This is two step process.This byte code is platform independent and can be ported across any OS.So in a particular OS ,if you install OS specific JDK ,the interpreter JVM in that OS converts the bytecode to machine code of that OS.

About the Author

Dear Friends,
I am A.K.M. .This online journal ai1tutorial.com is a humble effort from my side to all students and professionals who want to learn computer science related technologies.I am not a professional blogger and I write posts in this blog only in my leisure time.I may not be 100% perfect in all my posts,but your review comments can surely help me to make it 100% perfect.