Source of PrintArgs.java


  2: /**
  3:   * This program tells you about its command line arguments
  4:   *
  5:   * @author Mark Young (A00000000)
  6:   */
  7: public class PrintArgs {
  8:     public static void main(String[] args) {
  9:         // announce yourself
 10:         System.out.print("\n\n"
 11:                 + "About My Command Line Arguments\n"
 12:                 + "-------------------------------\n\n"
 13:                 + "My " + args.length + " command line arguments were:\n");

 15:         // print your arguments
 16:         for (int i = 0; i < args.length; i++) {
 17:             System.out.printf("%4d: \"%s\"%n", i, args[i]);
 18:         }
 19:         System.out.println();
 20:     }
 21: }