Thursday, 3 January 2013

JAVA MAGIC - BYTE CODE

BYTE CODE
When JAVA compiler compile the program it give "byte code" instead of executable code.
           This byte code is a highly optimized set of instructions which can be executed by java run time system known as JAVA virtual machine(JVM).  JVM is an interpreter for the byte code. This solve the problems associtaed with downloading across the network.
  • Translating a JAVA program into byte code make program to ran on different environment easily.  Because for each platform we have to implement JVM for that machine. Then any run-time package (Byte code) can run on the system with the interpreter JVM.
  • JVM also enhance the security because execution of every JAVA program is under the control of JVM. 
  • Since interpretion is slow compared to compiling but bytecode enables the JAVA run time system to execute program much faster.
  • Sun also designed JAVA-IN-TIME(JIT) compiler which give on the fly copilation of byte code into native code. JIT compiler compiles bytecode into executable code in real time one by one , as the demand.     

No comments:

Post a Comment