0
String[ ] object in main method
I am newbie in JAVA, i just curious why we must always pas String[ ] object in main method
3 Answers
0
It's because the main method is a normal method, and can be used with arguments.
This String object is the array which can contains arguments
0
i see, but actually i never pass any parameter within main method. But if i remove String [ ], it would be return error message when i run the program. FYI , i use Intelij IDEA as IDE.
0
I don't know i never tried to remove it, you can test that, but to my mind it's not a good idea, you never know maybe you will need to use arguments, as your code will change