Sunday, June 12, 2011

Javas Magic "The Bytecode"

                                  Java Program (eg class files)
                                                       |
                                                       |
JVM (Java Virtual Machine) part for JRE (Java Runtime Environment)
                                                       |
                                                       |
 JVM converts the Java Program to Bytecodes and talks to the machine    

Bytecodes are the machine language of the Java virtual machine. When a JVM loads a class file, it gets one stream of bytecodes for each method in the class


*Java Bytecode is Highly optimised for speed of execution.


$javac testfile.java

This will create a testfile.class which will have java bytecode version of the program.

To actually run the program 

You run,
$java testfile (class file name).






 Also read for more info:

http://www.javaworld.com/javaworld/jw-09-1996/jw-09-bytecodes.html




No comments:

Post a Comment