+ 1
what is [] in public static void main(String [] args)?
java question
8 ответов
+ 10
Creates an "args" String and makes it an Array.
+ 9
Me neither ~_~ (yet)
+ 4
Java only starts running a program with the specific public static void main(String[] args) signature, and one can think of a signature like their own name - it's how Java can tell the difference between someone else's main() and the one true main().
String[] args is a collection of Strings, separated by a space, which can be typed into the program on the terminal. More times than not, the beginner isn't going to use this variable, but it's always there just in case.
+ 3
why it is in the main method then? i dont get it
+ 3
then can it be modified as ( int[] args)?
+ 3
Nope It's tell that no main method you must use that for sure
+ 3
java is very broad....ty for answer