Read : http://www.learnjavaonline.org/en/Hello%2C_World%21
public
means that anyone can access it.static
means that you can run this method without creating an instance of Main
.void
means that this method doesn't return any value.main
is the name of the method.System
is a pre-defined class that Java provides us and it holds some useful methods and variables.out
is a static variable within System that represents the output of your program (stdout).println
is a method of out that can be used to print a line.(See "1.0 Setting up" for a detailed description)
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Created: Dexin, March 2018
Updated: Dexin, 4/12/2018