Monday, November 10, 2008

Getting Started


It has been a while after my previous post as I'm quite busy lately. Now, let's us get back to our business.



Below is a java sample code for the traditional Hello World program. Basically, the idea behind this Hello World program is to learn how to create a simple java program, compile and run it. To create your java source code you can use any text editor.



public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}


Output:
Hello World


Java Main Method Declarations

  1. public static void main(String[] args){}

  2. public static void main(String []args){}

  3. public static void main(String args[]){}

  4. static public void main(String[] args){}

  5. public final static void main(String[] args){}

  6. public static void main(String... args){}


All the 6 above are valid main method's.

1 comment:

irkhairuddin said...

hmmmm...too nice, duke...keep blogging...hahaha :)