+ 2

[DUPLICATE] Why we write String args()

22nd Apr 2018, 7:02 AM
Trayambak Mishra-
Trayambak Mishra- - avatar
4 Answers
+ 13
"String[] args" is used to collect commandline arguments/data for your program. Ex: You can run your program with links to files you want it to use. If you want to see other answers, you can search for similar questions, like this one: https://www.sololearn.com/Discuss/1524/?ref=app By the way, welcome to the SoloLearn Q&A, Trayambak! ^_^ Have fun learning, and happy coding! Here are our general posting guidelines: https://www.sololearn.com/discuss/321242/?ref=app https://www.sololearn.com/Discuss/593497/?ref=app https://www.sololearn.com/Discuss/333866/?ref=app
22nd Apr 2018, 7:57 AM
Tamra
Tamra - avatar
+ 4
String[] args is a String array containing the argument for the JVM. It's just a variable name, you could it also name String[] cmd or String[] xyz instead.
22nd Apr 2018, 7:22 AM
Jonas Schröter
Jonas Schröter - avatar
+ 1
it creates an Array of strings maybe used by the compiler for some task i'll come to know about soon welcome to sololearn community Trayambak!!!!! keep asking and clearing doubts!
22nd Apr 2018, 11:39 AM
Devansh Gupta
Devansh Gupta - avatar