LoopTest.javaFrom WikiJava
This Java application can accept any number of arguments from the command line. Command line arguments allow the user to affect the operation of an application.
the articleThis is a simple application that accepts arguments passed from the command line by a user, and prints them out to the screen. Example, The user would enter the folowing comand at the comand line; C:\ java testingloops.LoopTest Tusker Pilsner Castle command line argumentspackage org.wikijava.testingloops; /** * @author Alex Mutuku Mbolonzi * @version 07/06/08 */ public class LoopTest { public static void main(String args[]){ //loop iterates through the arguments entered by the user and print's to screen. for (String i: args){ System.out.println(i); } } } |

thanks for sharing:)
--DonGiulio 08:49, 17 September 2008 (PDT)