/** * This program takes two inputs from the command * line, converting them from strings to integers, * then adding them. This program improves on * SomeSum4 by adding that the user entered the * appropriate number of arguments. * * After compiling, run with: * $ java SumSome4 2 3 */ class SumSome4 { public static void main(String[] args) { if (args.length != 2) { System.out.println("Usage: java SumSome4 "); System.exit(1); } int x = Integer.valueOf(args[0]); int y = Integer.valueOf(args[1]); System.out.println(x + y); } }