Java Beginner

Classes, main, printing, types and control flow.

3 lessons 7 tasks ⚡ Live compiler
Lessons Compiler Quiz Certificate

📚 Lessons

1 Classes & main

Every program lives in a class; execution starts in public static void main. Print with System.out.println.

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
        System.out.println("Sum: " + (3 + 4));
    }
}

2 Variables & types

Java is statically typed: int, double, boolean, String. Use + to join strings and values.

public class Main {
    public static void main(String[] args) {
        int age = 30;
        String name = "Linus";
        System.out.println(name + " is " + age);
    }
}

3 Loops & conditions

Control flow uses for, while and if/else, just like other C-family languages.

public class Main {
    public static void main(String[] args) {
        for (int i = 1; i <= 5; i++) {
            if (i % 2 == 0) System.out.println(i + " even");
            else System.out.println(i + " odd");
        }
    }
}

⚡ Java Compiler

Code runs on a learning-oriented simulated runtime that supports common constructs (output, variables, arithmetic, conditionals and loops).

JAVA

            

📝 Tasks

7 tasks across 3 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.

🎓 Certificate of Completion

🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.