// Textbook fragment 01.05 Scanner input = new Scanner(System.in); System.out.print("Please enter an integer: "); while (!input.hasNextInt()) { input.nextLine(); System.out.print("That's not an integer; please enter an integer: "); } int i = input.nextInt();