2 Replies Latest reply: Jun 19, 2013 3:29 PM by rp0428 RSS

    Method not working

    6f6281a0-69b9-4167-af47-e84d9f2cb14b

      I wrote up a real simple app to check out readInt and am having trouble with it.

       

      {code}


      package add2integers;

       


      public class Add2Integers{

       

        
          public static void main(String[] args) {
             
              Run run = new Run();
              run.go();
          }
      }

       

      {code}
      package add2integers;

       


      import acm.program.*;
      public class Run extends ConsoleProgram{
          public void go(){
             
             
              println("This program adds two integers.");
              int n1 = readInt("Enter n1: ");
              int n2 = readInt("Enter n2: ");
              println("The total is " + (n1 + n2) + ".");
             
         
          }
         
      }

       

      I don't get any errors but when I run the program, nothing happens.  Using NetBeans.