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 an empty class? What functionality does it offer in Java?
what is the constructor and how many types of constructors are used in java?
What do you mean by Function Overloading in java?
What are the java ide’s?
Explain covariant method overriding in java.
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
What is hash in java?
What is the use of protected in java?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.
Explain the reason behind ending a program with a system.exit(0)?
Difference between error and exception
What is the difference between static and non-static variables in java programming?
Which is bigger float or double?
Can java program run without jre?
Explain the differences between abstraction and encapsulation?