Source of Arguments.java


  1: /* 
  2:  * Copyright (c) 1999-2002, Xiaoping Jia.  
  3:  * All Rights Reserved. 
  4:  */
  5: 
  6: /**
  7:  *  This program prints out the command line arguments
  8:  */
  9: public class Arguments {
 10: 
 11:   public static void main(String[] args) {
 12:     if (args.length > 0) {
 13:       for (int i = 0; i < args.length; i++) {
 14:         System.out.println("args[" + i + "]: " + args[i]);
 15:       }
 16:     } else {
 17:       System.out.println("No arguments.");
 18:     }
 19:   }
 20: 
 21: }
 22: