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 an escape character in java?
What is the java virtual machine?
Can we overload the methods by making them static?
How many types of design patterns are there?
What is lazy initialization in java?
What is parsing in grammar?
How many decimal digits is 64 bit?
java Technical questions asked by JPMC
How many functional interfaces does java 8 have?
Is Java a dying language?
Can a class extend more than one class?
Why null value is used in string?
Is array primitive data type in java?
Can I learn java in 3 months?
What is api in java?