Sunday, 7 August 2016

Q-2:is it possible to run program without main method?


Ans:

class abc
{
 static
{
System.out.println("HelloWorld");
}
}

Note: this code working upto jV 6 version below this version display the error 

please define the main method public static void main(String [] args).

No comments:

Post a Comment