What happens when a main method is declared as private?
Answer Posted / srinivasa
JVM is also a program. If main() is declared as privateit
is not available outside of that class . So JVM through the
exception.
Is This Answer Correct ? | 15 Yes | 5 No |
Post New Answer View All Answers
What is a memory leak in java?
What are the 4 types of characters?
What is the base class of all exception classes in java?
Difference between object and reference?
How are this() and super() used with constructors in java programming?
What is the static keyword?
Can we use return in constructor?
If you do not want your class to be inherited by any other class. What would you do?
What is the purpose of final keyword and when to use it?
What is continuity of a function?
What is runtime polymorphism or dynamic method dispatch?
In java, how many ways you can take input from the console?
What is singleton class example?
What is sizeof () operator?
What is token in java?