GFact 48 | Overloading main() in Java Last Updated : 03 Sep, 2018 Improve Improve Like Article Like Save Share Report Consider the below Java program. // A Java program with overloaded main() import java.io.*; public class Test { // Normal main() public static void main(String[] args) { System.out.println("Hi Geek (from main)"); Test.main("Geek"); } // Overloaded main methods public static void main(String arg1) { System.out.println("Hi, " + arg1); Test.main("Dear Geek","My Geek"); } public static void main(String arg1, String arg2) { System.out.println("Hi, " + arg1 + ", " + arg2); } } Output: Hi Geek (from main) Hi, Geek Hi, Dear Geek, My Geek Important Points: The main method in Java is no extra-terrestrial method. Apart from the fact that main() is just like any other method & can be overloaded in a similar manner, JVM always looks for the method signature to launch the program. The normal main method acts as an entry point for the JVM to start the execution of program. We can overload the main method in Java. But the program doesn’t execute the overloaded main method when we run your program, we need to call the overloaded main method from the actual main method only. Related Articles : Valid variants of main() in Java Overload main in C++ Can we Overload or Override static methods in java ? Like Article Suggest improvement Previous Static Block and main() method in Java Next Static methods vs Instance methods in Java Share your thoughts in the comments Add Your Comment Please Login to comment... Similar Reads Java main() Method - public static void main(String[] args) Does JVM create object of Main class (the class with main())? Method Overloading in Java Constructor Overloading in Java Overloading Variable Arity Method in Java Constructor Overloading with Static Block in Java super keyword for Method Overloading in Java Java Program to Find Area of Rectangle Using Method Overloading Java Program to Find Area of circle Using Method Overloading Java Program to Find Area of Square Using Method Overloading Like H Himanshi Gupta Article Tags : Java-Overloading Java Practice Tags : Java