Camp 1 · Step 2 of 13
Hello, World!
Run your first Java program and decode the famous public-static-void-main ceremony, one word at a time.
Every Java program you'll ever read starts with the same incantation. Let's run it, then translate it word by word.
Run it first
(This playground compiles and runs real Java in a cloud sandbox — the first run can take a few seconds.)
The translation
| Piece | Meaning |
|---|---|
public class Main | "Here is a class named Main" — all Java code lives in classes |
public | visible from outside |
static | belongs to the class itself, no object needed |
void | this method returns nothing |
main(String[] args) | the entry point — where every Java program begins |
System.out.println(...) | print a line to the console |
You don't need to fully absorb static yet — for now, the honest
summary is: main is the front door, and the JVM knocks on exactly
this signature.
The three unbreakable rules
- Statements end with
; - Blocks are wrapped in
{ } - The file's class name matches the file name (
Main↔Main.java)
Miss a semicolon and the compiler stops you with the exact line — try deleting one above and running.
Where does a Java program begin executing?
What happens if you forget a semicolon at the end of a statement?
What's next
What actually happens between your .java file and output on the screen —
the compile-and-run pipeline.