Saturday, January 12, 2013

SimpleHelloWorldExample


package com.basics;
/*
 *
 * WHY DO MAIN METHOD NEED TO HAVE RTEURN TYPE AS VOID
 */
public class HelloWorld {


HelloWorld hw = new HelloWorld();

// String[] test;

//hw.main(test);

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


/*public static void main(String... args){
System.out.println("Hello World>>>>>>>>");
}*/

/*static public  void  main(String... args){
System.out.println("Hello World::::::::::::::::");
}*/

/* static   void  main(String... args){ //error as main need to be public
System.out.println("Hello World::::::::::::::::");
}
*/

public static String main(String args[]){
System.out.println("Hello World............");
return "akkhil";
}
/*
public static void main(String args[]){
// System.out.println("Hello World............");
return;
}*/

}

No comments:

Post a Comment