Back to Top

Monday 16 January 2012

JAVA : What if we 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.

3 Responses to “ JAVA : What if we have multiple main methods in the same class? ”

Anonymous said...
17 April 2012 at 00:23

you can over load the main method.....


Venkatesh CS said...
29 May 2019 at 16:22

Wonderful article, very useful and well explained.
Java Training in Velachery


West Haven Boilers said...
17 July 2022 at 21:15

This is a great post thanks for writing it


Post a Comment

Popular Posts

Subscribe via Email
Subscribe Java Interview Questions via Email
All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar