All pastes #833538 Raw Edit

Stuff

public text v1 · immutable
#833538 ·published 2007-12-27 10:52 UTC
rendered paste body
public class AddArguments2 {
	public static void main(String args[]) 
	{
		
		try {
			int sum = 0;
			for (String arg : args) {
				sum += Integer.parseInt(arg);
				{
					System.out.println("Sum = " + sum);
				}
			}
		}
		catch (NumberFormatException nfe) {
			System.err.println("one of the command line " 
			+"arguments is not an integer."); 
		}
	}
}