Command line arguments
Command line arguments
When you run programs from the command line (pictured below) you enter the name of
the program followed by a list of arguments that the program can access (or ignore).
The length of the array args.length tells your program how many arguments
there are. You should always check that the user provided as many
arguments as your program expects before trying to access them.
args.length );
System.out.println(args[i]);
System.out.println(args[i]);