0
Why always main function receives array of Strings as input parameters?
3 Answers
0
These are the Strings you give as parameters calling the program e.g. via command line.
For Example:
myprogram -option1 -option2
-option1 is the first array member and -option2 the second
0
can it be like main(int bob) ?
0
Command Line Arguments were given as Strings. I guess main(int i) will result in an exception. But you can easily convert the Strings to Integers using the Integer class.
int i = Integer.parseInt(String xyz)
But be careful to parse arguments without checking, otherwise you will get an exception.