Concept Flow - What is Java
Write Java Code
Compile with javac
Bytecode (.class files)
Run with JVM
Java Program Executes
Java code is written, then compiled into bytecode, which the Java Virtual Machine (JVM) runs to execute the program.
public class Hello { public static void main(String[] args) { System.out.println("Hello, Java!"); } }
| Step | Action | Details | Output |
|---|---|---|---|
| 1 | Write Code | Create Hello.java with main method | |
| 2 | Compile | Run javac Hello.java | Generates Hello.class bytecode |
| 3 | Run JVM | Run java Hello | Starts JVM and loads Hello.class |
| 4 | Execute main | JVM calls main method | Prints: Hello, Java! |
| 5 | Program Ends | main method finishes | Program stops |
| Variable | Start | After Step 4 | Final |
|---|---|---|---|
| args | empty String[] | String[] with command line args | No change after main ends |
Java is a programming language where you write code, compile it into bytecode, and run it on the JVM. This makes Java programs work on many computers without change. The JVM runs the bytecode and handles the program execution. A simple Java program has a main method where execution starts. Compilation is needed before running the program.