Hi,
Java can be used with any platform. How and Why Java is a platform independent language?
Thanks
Hi,
Java is Platform Independent programming language it means that if you compile it on the windows platform you can run the program on any platform for example on Mac, Linux, Unix etc.
So, Java supports "Write once run anywhere" concept and it allows you to run your program anywhere.
Why Java is Platform Independent?
Due to bytecode: Java program is compiled into byte code and the byte code then runs on the targeted platform. On the targeted platform it is (byte code) is compiled into binary language in run-time by JVM and then it runs.
JVM: JVM is actually platform dependent and you need to have different JVM for different platforms. JVM makes Java program platform independent. Check for more detail: Java Virtual Machine(JVM). Thanks
Hi,
Java is platform independent language because it compiles the Java source code into bytecodes. The bytecodes is not the machine code and it needs a special program call interpreter for converting it into machine code. In case of Java JIT (Just-in-time) compiler is the Interpreter which converts the compiled bytecodes into machine language on the host machine. Once the bytecodes is converted into machine language it is executed on the host machine.
The JVM is available for almost all the operating system and you can deploy your compiled Java code (in jar format) on the variety of platforms.
Check the tutorial: Java Interpreter is used for which purpose?
Above tutorial shows you the working of Java Compiler and Interpretor.
Thanks
Hi,
Here is more detail about the Java Programming language. Check it at:
Thanks
Ads