title: Do-While loop on user input - check if input is not empty or int (java)
body: <p>I want the user to be repeatedly asked a question if the user input is either empty OR not an int. This is what I have so far:</p>
  
  <pre><code>        Scanner scn = new Scanner(System.in);
          do {
              System.out.print("Enter id: ");
              int id = scn.nextInt();
           } while (!scn.hasNextInt());
  </code></pre>