public class FirstProgram
1: //FirstProgram.java
2: //A simple application program to add two numbers.
3:
4: import java.util.Scanner;
5:
6: public class FirstProgram
7: {
8: public static void main(String[] args)
9: {
10: System.out.println("Hello out there.");
11: System.out.println("I will add two numbers for you.");
12: System.out.println("Enter two whole numbers on a line:");
13:
14: int n1, n2;
15:
16: Scanner keyboard = new Scanner(System.in);
17: n1 = keyboard.nextInt();
18: n2 = keyboard.nextInt();
19:
20: System.out.println("The sum of those two numbers is");
21: System.out.println(n1 + n2);
22: }
23: }