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 nested class in java?
How do you compare arrays in java?
What is ordered map in java?
What is the scope or life time of instance variables?
How can constructor chaining be done by using the super keyword?
What is boolean keyword in java?
What is the size of boolean variable?
Find the value of a specified element of the array arr[i] where 0 <= i <= n-1
What state does a thread enter when it terminates its processing in java programming?
Is array size fixed in java?
What is the flag in java?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
what is a thread pool in java and why is it used?
What does next mean in java?
Why arraylist is used in java?