is possible to overload a main method? If yes from which method the jvm will start executing?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. The main method can be overloaded just like any other method in Java.
The usual declaration for main is
When you launch a java application it looks for a static method with the name ‘
main‘, return type ‘void'and a single argument of an array of Strings. ie what you throw is unimportant in resolving this method.Overloading is providing multiple methods with the same name but different arguments (and potentially return type).
With the above explaination we can overload the main method.