+ 2

[DUPLICATE] public static void main(String[ ] args) in here what is args doing exactly?

5th May 2017, 3:13 PM
PASINDU LAKSARA
PASINDU LAKSARA - avatar
3 Answers
+ 11
You can pass arguments to your program if you start it via console/ide, see: https://docs.oracle.com/javase/tutorial/essential/environment/cmdLineArgs.html All arguments will be stored in the String array named args and you can access and handle them in your program.
5th May 2017, 3:18 PM
Tashi N
Tashi N - avatar
+ 2
thanks Tashi got it well
5th May 2017, 6:29 PM
PASINDU LAKSARA
PASINDU LAKSARA - avatar
+ 1
in simply "args is an array of console line argument whose data type is String"
6th May 2017, 9:17 AM
PASINDU LAKSARA
PASINDU LAKSARA - avatar