Is there is any error if you have multiple main methods in
the same class?
Answer Posted / nisha
The compilation error, if you have multiple main
methods in the same class.
Error like :java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source
code - main(java.lang.String[]) is already defined
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is void a return type?
What is consumer interface?
Can private class be extended java?
What are the main uses of the super keyword?
How to display arraylist values in java?
what is optional in java 8?
What is variable argument in java?
What is a line separator in java?
Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?
Are there structures in java?
How use .contains in java?
What is final keyword in java?
What is api in java?
Explain the difference between serializable and externalizable in java?
How do you delete a list in java?