+ 1
Can the main method be overloaded in java?
How can this be possible...? If at all the main method could be overloaded, it would mean that there are two(or more)methods with the name "main". Since the main method is implicitly provoked, which one of those overloaded main methods shall get executed?
8 Réponses
+ 2
Not sure. If yes, only one to run is one with correct parameters.
+ 2
Yes, when main gets called, it will be called with the parameters that should be there, meaning that the others will never be used.
+ 2
Yes
+ 1
@Jacob Pembleton By "correct parameters"....do you mean.. a string array?
+ 1
@Jacob Pembleton Then does that mean that overloading a main method is of no use? And only the one with the string array as its parameter type is valid?
+ 1
@Jacob Pembleton Thanks for answering😊😊
+ 1
@ Martin Taylor Thanks for answering 😊😊