Java First Program "HelloWorld"

Posted by jineesh uvantavida on Thursday, January 6, 2011 Under: Java
// Outputs "Hello, world!" and then exits
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}


In this program, we are defining the class HelloWorld. And the file name should be HelloWorld.java. This simple program only contains a single line to print "Hello, world!".
And every program should contain a main class to execute the program.

In : Java 



Translate This Page

 


Make a free website with Yola