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
Where is core java used?
What is complexity and its types?
What do you mean by singleton class in java?
how would you implement a thread pool? : Java thread
What does it mean that a method or field is “static”?
What is the main purpose of serialization in java?
What is the difference between the final method and abstract method?
Explain jdk, jre and jvm?
What is the tradeoff between using an unordered array versus an ordered array?
What is a conditional equation?
What is pass by value?
What is the difference between the direct buffer and non-direct buffer in java?
Define jit compiler?
Why is singleton class used?
What is the difference between a switch statement and an if statement?