could you run the java program without main method?
Answer Posted / amit singh
please put the System.exit(0) in static block thanks
class Moon
{
static
{
System.out.println("hello i am visible without main");
System.exit();
}
}
amit singh
amising2008@gmail.com
| Is This Answer Correct ? | 29 Yes | 8 No |
Post New Answer View All Answers
What are parsing rules?
Does java allow default arguments?
What do you understand by copy constructor in java?
What is the difference between checked exception and unchecked exception?
What is abstract class constructor called?
Is there any difference between nested classes and inner classes?
How many types of array are there?
How do you sort a string in java?
what is collatration?
Which collections are thread safe in java?
What is the collections api in java programming?
How do I enable java in safari?
Why constructor has no return type?
Explain about arraylist?
Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain