0
Can we overload the main() method in java? If yes then which will be executed first?
3 Antworten
+ 2
It's just a method, like any other, except that JVM searches for only this method whenever your run your code, and so yes you can overload main as well but remember only public static void main( String[] args) method will be used when you run your program. You can call other overloaded methods inside the main(String[] args) method.
+ 2
You can overload the main()method, but only public static void main(String[] args) will be used when your class is launched by the JVM
+ 1
You can't overload it cuz it already has a type void and parameter type String array