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

Explain wait(), notify() and notifyall() methods of object class ?

802


what is thread? What are the high-level thread states? : Java thread

1003


What is protected access modifier?

783


What is the simpletimezone class in java programming?

807


How do you stop a thread in java?

804


What is integer valueof?

847


What is static method with example?

856


What is e java?

759


How many bits is a string?

729


Can we execute a program without main?

733


Explain throw keyword in java?

812


What is the r character?

781


How to display arraylist values in java?

708


What does escaping a character mean?

720


Explain about doubly linked list

822