title: Limit number of prompted arguments
body: <p>I want to prompt the user to input just two numbers which represent the size NxN of a board. If the user write less than 1 or more than 2 numbers, the program don't allow him to do that and instead, handle this by an exception.</p>
  
  <p>For example:</p>
  
  <pre><code>public class Tester {
  
  public static void main(String[] args) {
  
      Scanner userInput = new Scanner(System.in);
  
      System.out.print("Board size NxN: ");
  
      int width = userInput.nextInt();
      int height = userInput.nextInt();
  }
  }
  </code></pre>
  
  <p>How can achieve this using a try-catch block limiting the user to input only 2 numbers?</p>