CAN I HAVE MULTIPLE MAIN METHODS IN THE SAME CLASS?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 513  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    Can I have multiple main methods in the same class?

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!