|
Java™ by example!
|
|
|
How can I count the numbers of command-line arguments supplied at runtime?
eg.
 class Main { public static void main(String []args) {
System.out.println("Number of arguments: " + args.length); for (int i=0; i<args.length; i++) { System.out.println("Argument " + i + ": " + args[i]); } } }
|
Here's a nice package for parsing command-line parameters:http://www.ddj.com/articles/1996/9602/9602e/9602e.htm
Further Information
Author of answer:
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|