Hello, Java! ☕
beginner20 XP

Your First Java Program

Build a robot's 'start button' and make it talk.

Your First Java Program 🤖

Java is everywhere: in Android phones, Minecraft (Java Edition!), bank systems and competition robots. Many student robotics teams program their robots in Java. Today you write your first Java program. Here it is:

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

Whoa, that's a lot of words just to say hello! Don't panic. Think of it like a robot:

PartThink of it as
public class Mainthe robot's body: everything lives inside it
public static void main(String[] args)the START button: Java begins running here
System.out.println(...)the robot's speaker: it says things out loud
{ } curly bracesthe walls that show what's inside what
; semicolonthe full stop at the end of every instruction
💡

🧠 For now, copy the first two lines and the closing braces exactly. You'll learn what each word means later. Today you only write the lines inside main.

Saying more things

Each println says one line:

Java
public class Main {
    public static void main(String[] args) {
        System.out.println("Systems check...");
        System.out.println("Wheels: OK");
        System.out.println("Ready to roll!");
    }
}

🔍 Predict it!

Before you run code, guess what it will print. Real programmers do this all the time; it trains your brain to think like the computer.

🚀 Fun fact

Java was invented in the 1990s by a team at Sun Microsystems. It was first called Oak, after a tree outside the creator's office!

☕

Want to run it yourself?

Predict what the code prints first, then check! Copy an example above, paste it into the free online Java editor, and press Run. Keep the first line as public class Main.

Open the online Java editor ↗

Opens Programiz, a free site that isn't run by First Coding Path and may show ads. Grown-ups, you might like to take a look first.

Quick check

01/5
What does System.out.println("Ready!"); print?