Tuesday 26 July 2011

Java’s Magic: The Bytecode


The secrets behind the security and portability of Java is that the output of a Java computer is not executable code.Rather, it is Bytecode  
Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system, which is called the Java Virtual Machine (JVM)
JVM is an interpreter of Bytecode        
Java systems contain:
-Environment
-Language
-APIs
-Class libraries
Java programs normally undergo five phases
(1)    Edit
-Programmer writes program )and stores program on disk)
(2)    Complete
-Compiler creates bytecodes from program
(3) Load
-Class loader stores bytecodes in memory
(4)Verify
-Verifier ensures bytecodes do not violate security requirements
(5)Execute
-Interpreter translates bytecodes into machine language
Benefits of Bytecode
-Translating a Java program into Bytecode helps makes it much easier to run a program in a wide variety of environments
-Only JVM needs to be implemented for each platform
-Once the run time package exists for a given system, any java program can run on it

      

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More