If your program needs to support a numeric command-line argument, it must convert a String argument that represents a number, such as "34", to a number. Here's a code snippet that converts a command-line argument to an int:
if (args.length > 0)
firstArg = Integer.parseInt(args);
parseInt throws a NumberFormatException if the format of args isn't valid. All of the Number classes--Integer, Float, Double, and so on--have parseXXX methods that convert a String representing a number to an object of their type.