title: Looping Try Statement
body: <p>I am trying to loop a try block every time an exception is thrown.</p>
  
  <p>An example might be when the program prompts for a double and the user enters a string, so, a NumberFormatException is thrown. So the program will request the user to re-enter.</p>
  
  <p>Here's what I am doing currently. Is this the proper way to do so or is there better way?</p>
  
  <pre><code>// infinite loop
  for (;;)
  {     
      try 
      {
          //do something
          break; // if an exception is not thrown. it breaks the loop.
      }
      catch (Exception e)
      {
          //display the stack trace.
      }
  
      // restarts the for loop
  }
  </code></pre>