Program Internal

Home / Core Java / Program Internal

Program Internal


Internal Details of Hello Java Program :

"When you write and execute a 'Hello, World!' program in Java, there's a sequence of actions that occur in the background."

What happens at compile time?

When you compile Java code, the Java Compiler turns it into a kind of code called bytecode. This bytecode works on any computer with a Java program, sort of like a common language for your code to run everywhere.


                                     


What happens at runtime?

At Runtime following steps takes placed :

                                                                    



Class File :  A class file in Java contains compiled bytecode that can be executed by the Java Virtual Machine (JVM).

Classloader:  A classloader in Java dynamically loads classes into memory, enabling the Java Virtual Machine to access and execute them during runtime.

ByteCode verified: It checks Java bytecode for unauthorized attempts to access objects, preventing security violations.

Interpreter: It interprets and executes instructions from the bytecode stream in Java.

Runtime: Runtime in Java refers to the period when a Java program is actively executing, encompassing memory management, code execution, and exception handling.

Hardware: In Java, "hardware" refers to the physical components of a computer system, while Java itself interacts with these components indirectly through the Java Virtual Machine (JVM).