Is there is any error if you have multiple main methods in
the same class?
Answer Posted / srikanth
No, there is no error if we have multiple main methods
in the same class.
because, while compiling we only specify one main method
name so, the JVM compiles it by taking the main method which
is specified by us while compiling.
Is This Answer Correct ? | 3 Yes | 23 No |
Post New Answer View All Answers
Difference between this() and super() in java ?
What causes memory leaks in java?
What is entry set in java?
Explain illegalmonitorstateexception and when it will be thrown?
What is append in java?
What is the use of static class?
Discuss about garbage collector in Java.
Explain about public and private access specifiers?
Why do we declare a class static?
What is the purpose of using break in each case of switch statement?
Why do we use string?
Name some classes present in java.util.regex package.
What is the benefit of lambda expressions?
What is double word?
How the interruptible method gets implemented?