Appearance
Java Hello World
Java Hello World Program
java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}Java Hello World Program Explained
- The
publickeyword is an access modifier that allows theHelloWorldclass to be accessible to all other classes in the same package. - The
classkeyword is used to declare a class in Java. - The
HelloWorldis the name of the class. - The
mainis the name of the method. - The
String[] argsis the parameter of themainmethod. - The
System.out.println()is used to print the text to the console. - The
Hello World!is the text that is printed to the console.
Java Hello World Program Output
shell
Hello World!Hello World!
Full Stack Ltd