scg/ch10/PrintAllArguments

From FANG

Jump to: navigation, search

01 package scg.ch10;
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 public class PrintAllArguments {
08   /**
09    * The main program: java PrintAllArguments starts by calling this
10    public static method. The method just uses a for-loop and
11    System.out.println to print each argument on a line by itself.
12    *
13    @param  args  The command-line arguments
14    */
15   public static void main(String[] args{
16     System.out.println("PrintAllArguments:");
17     for (int = 0; i != args.length; ++i{
18       System.out.println("  args[" + i + "] = \"" + args[i] + "\"");
19     }
20   }
21 }
22 
23 //Uploaded on Mon Mar 29 21:42:24 EDT 2010


Download/View scg/ch10/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