Tutorials

Java Basics


Program Internal Process


In this chapter we are going to see the process that our java code goes through when we compile and run it.

 

Consider the program 'Hello.java' that we explained in the last chapter of this tutorial.

 

Source file: Hello.java


public class Hello {

      public static void main(String[] args) {

            System.out.print("My first program in java");

      }
}

Internal process during compile time

  • When you compile the Hello.java file then the compiler creates a .class file
  • .class file is created with the name Hello.class
  • Hello.class contains byte codes

Java compilation Process by tutorials in hand

 

Byte code (.class file) is specialized set of instruction that JVM can read.

Thus this .class file consisting of byte code can be transported to other system, irrespective of the operating system it has, and could be executed comfortably without any issue.

This is what makes java a portable language. Because of the same reason java is also popularly known as Write once, run anywhere (WORA) language.

JVM is capable of reading, verifying the bytecode.

Any computer system on which JVM is installed will be capable of executing the compiled .class file (consisting of bytecode).



Please Share this page
Views : 125