Course Content
Core Java
About Lesson

Phase 1

Writing the source code i.e. Java program. Java source code files are given a name ending with the .java extension, indicating that the file contains Java source code.

Phase 2

Compiling Java program into Bytecodes. Using command javac (Java Compiler) to compile Java program. If the program compiles successfully, the compiler produces a .class file. The Java compiler translates Java source code into bytecodes that represent the tasks to execute in the execution phase. Java’s bytecodes are portable—without recompiling the source code, the same bytecode instructions can execute on any platform containing a JVM that understands the version of Java in which the bytecodes were compiled. The JVM is invoked by the java command

Phase 3

Loading Program into Memory. JVM places the program in the memory to execute it called loading. JVM’s class loader takes the .class files containing the program’s bytecodes and transfers them to primary memory. It also loads any of the .class files provided by Java that your program uses.

Phase 4

Bytecode Verification. As the classes are loaded, the bytecode verifier examines their bytecodes to ensure that they’re valid and do not violate Java’s security restrictions.

Phase 5

Memory is allocated for class variables and static fields, and they are initialized with default values. This phase prepares the runtime environment for the execution of the Java program.

Phase 6

Execution.  JVM executes the program’s bytecodes, thus performing the actions specified by the program.

Scroll to Top