CommandLine.java


Below is the syntax highlighted version of CommandLine.java from §2.1 Static Methods.


/******************************************************************************
 *  Compilation:  javac CommandLine.java
 *  Execution:    java CommandLine [command line arguments]
 *
 *  Print out the command line arguments, one per line.
 *
 *  % java CommandLine this is a test
 *  this
 *  is
 *  a
 *  test
 *
 ******************************************************************************/


public class CommandLine {
    public static void main(String[] args) {
        for (int i = 0; i < args.length; i++)
            StdOut.println(args[i]);
    }
}


Copyright © 2000–2022, Robert Sedgewick and Kevin Wayne.
Last updated: Thu Aug 11 10:15:13 EDT 2022.