+ 3

[DUPLICATE] Why args is being used

1st Oct 2017, 7:26 PM
Ayush
Ayush - avatar
4 Answers
+ 5
for settings you want to give the programm before it starts... could be enable debug or specifing the location of a config file ect. eg. java mycoolprogramm configfile.cfg now i am independent of the configfile name or location because it is inside the args of the program. or java mynotsofinishedprogram debug this could enable more debug information, etc... hope you get the idea!
1st Oct 2017, 7:47 PM
Chrizzhigh
Chrizzhigh - avatar
+ 2
String args[ ] is actually an array of java.lang.string type and its name is args here.when we run a java program then we can pass some input to our java program.these inputs are stored in this string array... we write args because of arguments being passed in the arrays.
2nd Oct 2017, 1:09 PM
Prabhat Thakur
Prabhat Thakur - avatar
+ 1
They are ingredients used in your code-recipe.
1st Oct 2017, 11:36 PM
👑 Prometheus 🇾🇬
👑 Prometheus 🇾🇬 - avatar