Java Hello World Example
Chapter:
Java Basics
Last Updated:
06-02-2017 02:43:52 UTC
Program:
/* ............... START ............... */
public class JavaHelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
/* ............... END ............... */
Output
Notes:
-
Java is an object oriented language (OOP). Objects in Java are called classes.
- A class can be defined as a template or blue print that describes the behaviours of object of its type support.
- Java prints hello world using System.out.println("Hello World").
- Main method in Java is an standard method which is used by JVM to start execution of any Java program. main method is referred as entry point of Java.
- main() method must be static.
- If main() is allowed to be non-static, then while calling the main method JVM has to instantiate it’s class.
Tags
Hello World, Java