Source of Errors.java


  1: //Errors.java
  2: 
  3: public class Errors
  4: {
  5:         public static void main(String[] args)
  6:         {
  7:                 System.out.println("Can you spot and fix the errors?);
  8: 
  9:                 System.out.println("Enter two numbers and I ");
 10:                 System.out.println("add them for you");
 11: 
 12:                 int n1, n2;
 13: 
 14:                 Scanner keyboard = new Scanner(System.in)
 15:                 n1 = nextInt();
 16:                 n2 = nextint();
 17: 
 18:                 System.println("The sum of the numbers is");
 19:                 System.out.println(n1 - n2);
 20:         }
 21: }
 22: