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
What are heterogeneous objects?
What is a class component?
Why we use methods in java?
Can a source file contain more than one class declaration?
How to pass arraylist to stored procedure in java?
What is the epoch date?
What is identifier with example?
Is it possible to compare various strings with the help of == operator? What are the risks involved?
What about main thread in java?
Print Vertical traversal of a Binary Tree.
What is jit and its use?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
How to make a class or a bean serializable?
What is difference in between java class and bean?
What is incompatible types in java?