What is the use of String[] args? Why does main method takes it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the use of String[] args? Why does main method takes it?

23rd Nov 2020, 3:22 PM
Shubhdeep Singh
Shubhdeep Singh - avatar
2 Answers
+ 1
To accept input through command line arguments.. Edit : Shubhdeep Singh https://www.tutorialspoint.com/Java-command-line-arguments.
23rd Nov 2020, 3:26 PM
Jayakrishna 🇮🇳
+ 1
It is the list of command line parameters given. They can be used to control the behavior, give a folder or file to use in your program etc.
23rd Nov 2020, 3:30 PM
Benjamin Jürgens
Benjamin Jürgens - avatar