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
How many types of operators are there?
Can you extend main method in java?
Can you give names of Container classes?
Is alive and join method in java?
List some java keywords sun like c, c + + keywords?
What is meant by final class?
Difference between arraylist and vector.
Can anonymous class have constructor?
What are the new features in java 8?
Explain what pure virtual function is?
What restrictions are placed on method overriding in java programming?
What is skeleton and stub?
What is a stringbuilder?
Do I need to import java.lang package any time? Why?
Is it possible for yielded thread to get chance for its execution again ?