title: Exception with try-catch and loop in Java
body: <p>In Java, what is the difference (in term of <strong>performance</strong>) between:</p>
  
  <pre><code>for (int i = 0; i &lt; count; i++) {
      try {
          // code that throws Exception
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>try {
      for (int i = 0; i &lt; count; i++) {
          // code that throws Exception
      }
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>