Monday, July 5, 2010

Java Command-Line Arguments

All command-line arguments are passed as strings.

javac prog.java
java prog this is test no 1

args[0]: this /* Arguments can be accessed by using args[i] */
args[1]: is
args[2]: test
args[3]: no
args[4]: 1 /* You must convert numeric values to their internal forms manually: Integer.parseInt(str) */

No comments:

Post a Comment