Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static int getNumber() {
- int checkNum;
- System.out.format("Please enter a 5-digit integer: ");
- try {
- Scanner keyBoard = new Scanner(System.in);
- checkNum = keyBoard.nextInt();
- } catch (java.util.InputMismatchException e) {
- System.out.format("Oops, that's not an integer!");
- }
- return checkNum;
- }
Add Comment
Please, Sign In to add comment