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


Please Help Members By Posting Answers For Below Questions

What is canonical name in java?

607


What is a function argument in java?

504


What is the size of a string in java?

531


Is string thread safe in java?

563


What is final class?

564






Define array. Tell me about 2-D array.

576


What is return code?

549


What is basic syntax?

534


What is the difference between applet and application?

534


What do you understand by access specifiers in Java?

572


What does arrays sort do in java?

527


What will happen if static modifier is removed from the signature of the main method?

511


What is jit compiler in java?

570


Can you call a method on a null object?

550


What is anti pattern in programming?

485