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

Method signature

class Greeting {
    public static void hello() {
       System.out.println("Hello World");
    }
    public static void hello(String message) {
       System.out.println("Hello World " + message);
    }
}

public class GreetingsB {
    public static void main(String[] args) {
        System.out.println("Hello");
        Greeting.hello();
        Greeting.hello("Brave New World");
    }
}


javac GreetingsB.java
java GreetingsB
Hello
Hello World
Hello World Brave New World