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"); } }
Liked By
Write Answer
Can we overload the main() method in java ?
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
13-Nov-2014