Thursday 23 January 2014

Why Java is platform-independent ?

There is mail reason java is platform independent that java generates byte code so you can also tell that java is secure because it generates byte code.

What is Byte Code.


Byte code is small class file it will automatically gangrenes by jvm(java virtual machine) compiler while you compile your program and that file extension will be .class.

Another benefit is that byte code is platform independent code so your program can run in any machine by using same byte code And Because of byte code java is secure.




What is JVM(Java Virtual Machine) ?

JVM is an interpreter for Bytecode.
The details of the JVM will differ from platform to platform, but all interpret the same Java Bytecode according to machine/platform.

The Bytecode which are generated by the compiler will be tested by the JVM on the execution of the program or we can say every Java Program is under the control of the JVM which checks the code on the runtime many times for viruses and any malicious.


The Bytecode generated by the compiler are also supported on any machine which has the JVM which makes Java a platform independent language.


0 comments: