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 is meant by Garbage collection?
Is array dynamic in java?
What are aggregate functions explain with examples?
What does sprintf return?
Can java list contain duplicates?
What is the difference between yielding and sleeping in java programming?
What is string builder?
What is passing value java?
Does .length start 0 java?
Explain thread life cycle in java?
Write code of any action class?
What is the impact of declaring a method as final?
What is lazy initialization in java?
What are 3 boolean operators?
What is t type java?