HelloWorld Program

Tutorial of  every  programming language usually starts with a HelloWorld application. It is simply displays a string in the console . The code of HelloWorld in java  is given here. Each java process starts with public static void main(String[]args) method . The java Virtual Machine will be calling this method. The main method should have public access modifier .It should be a class method ,so it is static also.Other objects will be called from the main method. Here the program only displays a single line of text in console using  System.out.println() method.

 

public class HelloWorld {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(“Hello World”);

}

}