1.

How Java achieves Platform Independence?

Answer»

Java is a platform independent programming language. It can operate on any platform i.e. operating system with LITTLE or no change.

The Java Virtual Machine plays a pivotal role in making Java a platform independent language. When the Java program is compiled, a .class file is created by the Java compiler. This .class file contains nothing but Java BYTECODE. The Java ByteCode is a highly developed set of instructions given to the Java Virtual Machine to generate the machine code. It is the machine code in the form of the .class file . ByteCode is independent on the version of JVM.

JVM is dependent on the system. So when the .class file is ported to the other system, that system’s JVM runs the bytecode and converts it into a machine level code which the system can UNDERSTAND. Thus Java ACHIEVES platform independence.

An important point to be taken in consideration is that the Java Virtual Machine does not have any knowledge in regard to the programming language. It only is AWARE of the binary format of the ByteCode and confirm that the .class file is as per Java ByteCode specification thus eliminating errors of running bad Java ByteCodes:



Discussion

No Comment Found