Java: Command Line Arguments

how to the access contents of (String [] args)

Conversion to numeric values

Command line args come in as Strings.

If you want an int, use Integer.parseInt as in this example from Oracle’s tutorial

int firstArg;
if (args.length > 0) {
    try {
        firstArg = Integer.parseInt(args[0]);
    } catch (NumberFormatException e) {
        System.err.println("Argument" + args[0] + " must be an integer.");
        System.exit(1);
    }
}

There are similar techniques for float, and double.

References