In java , inside the main function we use (Strings[] args) what is the use of this ??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

In java , inside the main function we use (Strings[] args) what is the use of this ???

5th Nov 2019, 4:18 AM
Venu D
3 Answers
+ 5
It is an array of strings used to access command line arguments.
5th Nov 2019, 4:52 AM
Sonic
Sonic - avatar
+ 2
It is used to pass command line arguments which you can access as args[0],etc.
5th Nov 2019, 4:51 AM
Jayesh Mishra
Jayesh Mishra - avatar
0
Thats just a argument inside main function. C# and other language got that too. Thats array of strings that access command arguments. You can let that empty if u want. I guess. Bacause i do in my IDE. Didnt got any error. May be IDE fix that for me. MAY BE.
5th Nov 2019, 10:28 AM
Walid Al Hasan
Walid Al Hasan - avatar