# Your First Program — Core Java

Source: https://www.geekswithgeeks.com/en/core-java/java-hello

> Write a Hello World class, understand the public static void main entry point, then compile with javac and run it on the JVM.

## Hello, World

Every application entry point is `public static void main(String[] args)`. The file name must match the public class name — `Hello.java`.

```java
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}
```

Output:

```
Hello, World
```

## Compile & run

`javac` produces `Hello.class`; `java` launches the JVM with that class. Since Java 11 you can also run a single file directly without compiling first.

```bash
javac Hello.java
java Hello

# or, one step (Java 11+):
java Hello.java
```

Quick check

**Quiz:** What does `javac` produce from a `.java` file?

- [ ] Native machine code for your CPU
- [x] Platform-neutral bytecode in a .class file
- [ ] An executable .exe
- [ ] Nothing — Java is interpreted line by line

*Answer:* Platform-neutral bytecode in a .class file. The compiler emits JVM bytecode; the JVM then executes (and JIT-compiles) it at runtime.
