title: The catch statement repeatedly executes
body: <p>I am trying to implement a (re)try-catch block.</p>
  
  <pre><code>Scanner sc = new Scanner(System.in);
  
  while (true){
      try {
          t = sc.nextInt();
          break;
      } catch (Exception e) {
          System.out.println("Please enter a whole number without any symbol(s)!");
      }
  }
  </code></pre>
  
  <p>But the problem here is that the control again goes into the catch block ones it reaches there and never attempts to execute the try block before that.</p>