command line arguments

How can i check whether my command line argument is a String or Integer or some other .

[94 byte] By [Modapothulaa] at [2007-11-27 10:58:10]
# 1

All command-line arguments are strings. If you want to use them as integer values or something else, you'll want to parse them.

~

yawmarka at 2007-7-29 12:13:56 > top of Java-index,Java Essentials,Java Programming...
# 2

Command line arguments are always String objects (that's why you get a String[]).

You might want to know wether a specific string contains text that can be interpreted as a number, 'though.

For this you can try Integer.parseInt() and catch a NumberFormatException. If the exception is thrown, it's not a number.

JoachimSauera at 2007-7-29 12:13:56 > top of Java-index,Java Essentials,Java Programming...