could you run the java program without main method?
Answer Posted / naga
yes,we can write and run a java program without using the
main method.
i.e By using static
example program...!
public void static( )
public class
{
public void static( )
{
System.out.println( "Without main method" );
System.exit(0);
}
}
Is This Answer Correct ? | 23 Yes | 22 No |
Post New Answer View All Answers
Compare java and python.
Which is better singleton or static class?
Can subclass overriding method declare an exception if parent class method doesn't throw an exception?
What is the syntax and characteristics of a lambda expression? Explain
Can we catch more than one exception in a single catch block?
What does a boolean method return?
What are static blocks and static initalizers in java ?
What do you understand by private, protected and public?
What happens if main method is not static?
Difference between final and effectively final ? Why is effectively final even required ?
What are loops in java?
Explain about core java?
What is singleton service?
What is the purpose class.forname method?
From the two, which would be easier to write: synchronization code for ten threads or two threads?