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
Write a program to check for a prime number in java?
What is the common usage of serialization? What exceptions occur during serialization?
What is core java used for?
What is difference between iterator and enumeration in java?
How many types of threads are there in java?
What is vector capacity in java?
What is array length in java?
How many types of interfaces are there?
What does ide stand for?
Can static methods access instance variables in java?
What is a string token?
Explain about the dynamic behavior of core java?
Which category the java thread do fall in?
What is r * in math?
What is passing parameters in java?