Can we overload main method
Answer: Sure you could overload main method without any issues but only public static void main(String args) will be used when your class is launched by the JVM. For example:
Above will always print:
You can call the main() method yourself from code and execution point the normal overloading rules will be applied.
Note: You can use a varargs signature, as that’s equivalent from a JVM standpoint shown below:
public static void main(String… args) is equivalent to public static void main(String args) from Java 1.5 onward.