Thursday, 5 September 2013

Byte Code

What is Byte Code?

Byte code is the actually command to the Java Virtual Machine not your Java code.
It is the intermediary code between the machine code and Java code. And only Java complier make the byte code.Human cannot read this code because its only for JVM.
Like in C,C++ they produce the native code instead intermediary code therefore C or C++ program cannot run on any other platform.

Sun Micro system introduce byte code due to platform independent mean your Java code can run on any Operating System and JVM run your byte code.
Byte Code have the extension of .class
Let suppose I have class Main.java and when I compile the Main.java  like
javac Main.java

when I press the enter key JVM convert or make the byte code of corresponding class and It have the extension like Main.class.If we want to run own Java class then we just  type like below

java Main

It actually call and execute the Java Byte code.

Here I give the picture from Google to explain the above mention 


No comments:

Post a Comment