Yes, we can overload the main method in java ,but we need to provide different input parameter.But JVM wil start executing the method having String[] args as parameter
For Example,
public class OverLoadMain { public static void main(int [] ar) { System.out.println(" Overloaded Main"); } public static void main(String [] args) { System.out.println(" Main Methods"); } }
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Can you answer this question?
Write Answer1 Answers