title: How to make sure user doesn't enter letters
body: <p>In my program the user has to choose what they want to do and then hit the number next to the choice and then hit enter.</p>
  
  <p>Right now I have it so that any number that isn't a choice will give an error but now I want to make sure it says error if the user types in a letter for example "fadhahafvfgfh" </p>
  
  <p>here is my code...</p>
  
  <pre><code>import java.util.Scanner;
  
  public class AccountMain {
  
  
      public static void selectAccount(){
  
  
          System.out.println("Which account would you like to access?");
          System.out.println();
          System.out.println("1 = Business Account ");
          System.out.println("2 = Savings Account");
          System.out.println("3 = Checkings Account");
          System.out.println("4 = Return to Main Menu");
  
          menuAccount();
  
  
      }
  
      public static void menuAccount(){
  
          BankMain main = new BankMain();
          BankMainSub sub = new BankMainSub();
          BankMainPart3 main5 = new BankMainPart3();
  
          Scanner account = new Scanner(System.in);
  
          int actNum = account.nextInt();
  
          if (actNum == 1){
  
              System.out.println("*Business Account*");
              sub.businessAccount();
          }
  
          else if (actNum == 2){
  
              System.out.println("*Savings Account*");
              main.drawMainMenu();
          }
  
          else if (actNum == 3){
  
              System.out.println("*Checkings Account*");
              main5.checkingsAccount();
          }
  
          else if (actNum == 4){
              BankMain.menu();
  
          }
  
      }
  }
  </code></pre>