Styrow.dev
Question 11 of 247
Java Topic: General medium

Can we put more than one main method in single class?

Question

Can we put more than one main method in single class?

Answer

Yes we can, by overloading the main method. But JVM will by default run the main method with string array as an argument.