Hi,
can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?
Multiple main() methods in multiple classes in JAVA.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Nov 7, 2011, 7:56 AM EST
However, the entry-point of the application will be the main method in the class passed to the java runtime. So, if you have a main method in a class called Test and you type this at the console:
java Test
then Test's main method will execute first.