Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hoofdstuk 3 — Uitwerkingen Je eerste Java‑programma

Voorbeeldoplossingen:

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hallo, wereld!");
    }
}
public class NaamLeeftijd {
    public static void main(String[] args) {
        String naam = "Kim";
        int leeftijd = 20;
        System.out.println("Ik ben " + naam + " en " + leeftijd + " jaar.");
    }
}
public class SomDrie {
    public static void main(String[] args) {
        int a = 3, b = 4, c = 5;
        System.out.println(a + b + c);
    }
}
public class GroetDemo {
    static void groet(String naam) {
        System.out.println("Hallo, " + naam);
    }
    public static void main(String[] args) {
        groet("Saar");
        groet("Bo");
    }
}