What is the need for a String array in the main JAVA method

What is the need for the String array in the main JAVA method, it is designed to use command line argument programming and amp; now programming days with an IDE like eclllipse, netbeans no need to pass any initial arguments.

If this method signature is required for some purpose, why there is no main method that takes no arguments, and the JVM calls it to bootstrap a Java program. (If one does not want to send any initial parameter)?

+5
source share
3 answers

Why there is no main method that takes no arguments, and the JVM calls it to bootstrap a Java program. (If one does not want to send any initial parameter)?

  • Because it is not necessary. The JVM can trivially (and does) pass a zero-length array if there are no arguments.
  • Since providing multiple entry points does not facilitate the analysis of command line commands. In fact, if there were several entry points, there would be more opportunity for platform dependencies, application errors and / or developer confusion about which entry point is being called.
  • Since this is implemented by many other languages, there are advantages in doing the same as all the others (ceteris paribus).
+3
source

now a days programming with IDE like eclllipse, netbeans no need to pass any initial arguments.

IDE. , IDE ? - , . ?

, 2 ?

+1

, : / , . - , , main.

, . , , "" Windows Linux ( Finder Mac, ), .

+1

All Articles