Java · Lesson 1 of 3

👋 Your first Java program

Every Java program starts inside a class with a main method.

Java code lives inside a class. The program starts running from main.

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, CodingKida!");
    }
}
OUTPUTHello, CodingKida!

System.out.println() prints a line. Every statement ends with a semicolon ;

💡 Java is case-sensitive: System and system are different.

✏️ Your turn

Open this example in the playground, change it and run it.

▶ Try it yourself

🧠 Quick quiz

Where does a Java program start running?