Exercise
Function Parameters of Main, Sum
Objetive
Write a java program named "sum", which receives two integer numbers in the command line and displays their sum, as in this example:
sum 5 3
8
Example Code
public class Main
{
public static void main(String[] args)
{
if (args.length == 2)
{
System.out.println(Integer.parseInt(args[0]) + Integer.parseInt(args[1]));
}
else
{
System.out.println("Two numbers, please");
}
}
}