Whats the difference between "public static void main()" and 'public static void main(String [ ] args)"?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Whats the difference between "public static void main()" and 'public static void main(String [ ] args)"??

Im a beginner

28th Jan 2019, 4:38 PM
Jyothish Krishna
Jyothish Krishna - avatar
2 Answers
+ 8
String [] args is the command line arguments part. When command line arguments are passed then those are stored in that string args [] array
28th Jan 2019, 5:22 PM
Rstar
Rstar - avatar
+ 3
In the first case, you don't really care about the arguments being passed to your program. In the second case, they are stored in args.
28th Jan 2019, 5:55 PM
Zen
Zen - avatar