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 the difference between a threads start() and run() methods? : Java thread
how we can make a read-only class in java?
Define interface in java?
What is fail first in java?
Is 64bit faster than 32 bit?
What is the synonym of string?
What is the string function?
What does arrays sort do in java?
How do you convert an int to a string in java?
What is compiler and what its output.
Why strings in java are called as immutable?
Why string is immutable with example?
What is hash table in java?
What is java string pool?
What is integer size in java?