Jump to content

Beginning Java/First Program

From Wikibooks, open books for an open world

HelloWorld.java

[edit | edit source]
Below is the example of simple java program that writes "Hello, World!":

Code:

public class HelloWorld {
    public static void main(String[] arguments) {
        System.out.println("Hello, World!");
    }
}

Output:

Hello, World!

Main Method

[edit | edit source]