title: Why do I have a never-ending do-while loop?
body: <p>I have a non-working <code>do-while</code> loop.  When I enter a <em>String</em> instead of an <em>int</em>, it should say "bla" and ask again to insert a number, but instead it sends the message text over and over again. What's wrong in this code?</p>
  
  <pre><code>    boolean i = true;
      do {
         i = false;  
  
         try {
             System.out.println("insert number");
             int k = sc.nextInt();  
         }
         catch(InputMismatchException e) {
             System.out.println("test");
             i = true;
         } 
     } while ( i== true);
  </code></pre>