+ 3
[DUPLICATE] Why args is being used
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!
+ 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.
+ 1
They are ingredients used in your code-recipe.