Home > DeveloperSection > Interviews > Can I have multiple main methods in the same class?

Posted on    July-23-2015 1:17 AM

 Java Java 
Ratings:
 1 Answer(s)
  340  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-23-2015 1:17 AM

No the program fails to compile. The compiler says that the main method is already defined in the class.

Don't want to miss updates? Please click the below button!

Follow MindStick