scg/ch09/PrintAllArguments

From FANG

Jump to: navigation, search

01 package scg.ch09;
02 
03 /**
04  * A program showing how to use a for-loop to iterate across the
05  * arguments passed in to the program when it is run.
06  *
07  @author  blad
08  */
09 public class PrintAllArguments {
10   /**
11    * The main program: java PrintAllArguments starts by calling this
12    public static method. The method just uses a for-loop and
13    System.out.println to print each argument on a line by itself.
14    *
15    @param  args  The command-line arguments
16    */
17   public static void main(String[] args{
18     System.out.println("PrintAllArguments:");
19     for (int = 0; i != args.length; ++i{
20       System.out.println("  args[" + i + "] = \"" + args[i] + "\"");
21     }
22   }
23 }
24 
25 //Uploaded on Mon Mar 29 21:38:53 EDT 2010


Download/View scg/ch09/PrintAllArguments.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter

Games
Games