title: Missing return statement in method
body: <p>trying to figure this out.  I've created a method that checks if the user has entered an integer using a catch block.</p>
  
  <p>The method obviously is asking for a return statement but no matter where I put it it does not work.  Could anyone offer any advice?</p>
  
  <pre><code>public class Week5 {
  
      public static void main(String[] args) {
          Scanner myKeyboard = new Scanner(System.in);
          inputInt();
          inputDouble();
      }
  
      public static int inputInt(){
          Scanner myKeyboard = new Scanner(System.in);
  
          System.out.println("Enter number:");
  
          int num;
  
          boolean carryOn = true;
  
          while (carryOn == true) { 
              {
                  try { 
                      num = myKeyboard.nextInt();
  
                      carryOn = false;
                  }
                  catch (Exception e) {System.out.println ("Integers only, try again" ); 
  
                  myKeyboard.next();
                  return num;    
              }           
          }
      }
  }
  </code></pre>