Is there is any error if you have multiple main methods in
the same class?
Answer Posted / pranab dutta
No the program fails to compile, if you have multiple main
methods in the same class. The compiler says that the main
method is already defined in the class.
| Is This Answer Correct ? | 18 Yes | 8 No |
Post New Answer View All Answers
What is the use of generics? When was it added to the Java development Kit?
How a variable is stored in memory?
What are java annotations?
Which package is imported by default?
Why do we create public static method in java?
When is the finally clause of a try-catch-finally statement executed?
what is meant by Byte code concept in Java?
What is the default value of float and double datatype in java?
How do you create immutable object in java?
Does java allow overriding static methods ?
What is final method in java?
What is a numeric literal?
What is the difference between post and put?
Why generics are used in java?
Can a class have multiple superclasses?