I want the while loop to execute when the user's input is a non-integer value, an integer value less than 1, or an integer value greater than 3. Once the input is valid, I will use it. However, the loop only works when the user inputs a non-integer value. I have gone through the logic and I am still not sure what's wrong.
Code:
  Scanner scnr = new Scanner(System.in);
  do {
     System.out.println("Please enter an integer value 1-3 for the row.");
     while((scnr.hasNextInt() && (scnr.nextInt() > 3)) || (scnr.hasNextInt() && (scnr.nextInt() < 1)) || (!scnr.hasNextInt()))
     {
        System.out.println("Your input is not valid.");
        System.out.println("Please enter an integer value 1-3 for the row.");
        scnr.next();
     }
     row = scnr.nextInt() - 1;