I'm using a while loop to validate data ensuring the user enters only a number between 1 and 6. The loop catches the invalid entry no problem, but then when a correct number is entered it needs to be entered a second time in order to proceed. If I take out || menuScan.nextInt() > 6 the loop will work exactly as I need it to but I need to include this line in the loop.
while (!menuScan.hasNextInt() || menuScan.nextInt() > 6) {
menuScan.nextLine();
System.err.println("Please enter a valid menu option 1 - 6: ");
}
menuChoice = menuScan.nextInt();