I know that when you create your main
method of a Class
in Java
you create it as follows:
public static void main(String[] args)
I also know that the array
of Strings
named args
it's used to enter command-line parameters in the main
method but I develop my applications on Eclipse
and I never had used it because I always have entered my values by Scanner
.
It is a bad practise to use Scanner
instead of command-line parameters? Has args
array another purpose? When should I use args
array?
Thanks in advance!