Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.     private static int getNumber() {
  2.         int checkNum;
  3.  
  4.     System.out.format("Please enter a 5-digit integer: ");
  5.  
  6.         try {
  7.             Scanner keyBoard = new Scanner(System.in);
  8.             checkNum = keyBoard.nextInt();
  9.         } catch (java.util.InputMismatchException e) {
  10.             System.out.format("Oops, that's not an integer!");
  11.         }
  12.  
  13.         return checkNum;
  14.     }
Add Comment
Please, Sign In to add comment