Why we use [ ] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why we use [ ]

pls explain it static void SayHi() { Console.WriteLine("Hello"); } static void Main(string[] args) //??? { SayHi(); SayHi(); SayHi(); }

16th Aug 2017, 7:59 PM
Nazar Chornyi
Nazar Chornyi - avatar
2 Answers
+ 22
This array (args) contains the initial parameters passed from your compiler to the code upon run... Your IDE has an option to run code with specific params... Can also be blank...
16th Aug 2017, 8:06 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
In addition to ValentinHacker. [ ] stands for array. So the arguments that are given to the application are given in a array of string named args. args[0] will give you the first element.
16th Aug 2017, 9:18 PM
sneeze
sneeze - avatar