Wednesday 16 November 2016

EXECUTION OF JAVA PROGRAM

Execution of Java program can take place in two ways that are as follows:

  • Static Loading and
  • Dynamic Loading
In the process of Static Loading the block of code is loaded into the memory before it is executed that is if the code is loaded into the RAM (Random Access Memory).the code may or may not get executed.The process of static loading takes place in execution of Structural programming languages like C programming language which follows top down approach.


while on the other hand in Dynamic loading the block of code is loaded into the memory only when it needs to be executed.Java program execution follows Dynamic Loading.
The following steps are followed while executing Java program:

Java Virtual Machine also called as JVM would not convert all the statements of .class file into the executable code at a time.
Once the control comes out of method,then it is deleted from the RAM and another method of .exe type would be loaded .
Once the control comes out of main() method,it would be deleted from the RAM. That's the only reason we are not able to view the .exe contents of .class file.

No comments:

Post a Comment