title: When to use exceptions in Java (example)
body: <p>I know that this would be bad practice although I know that I would not be able to explain why.  </p>
  
  <pre><code>int [] intArr = ...
  ...
  try{
     int i = 0;
     while(true){
        System.out.println(intArr[i++]);
     }
  }catch(ArrayIndexOutOfBoundsException e){}
  </code></pre>
  
  <p>I think that you are only supposed to use exceptions for things that <em>shouldn't happen</em>.  I am asking this question because I think that I am using exceptions wrong sometimes.  If your programming is running <em>a standard case</em> should exceptions be thrown?  </p>
  
  <p>This seems related:
  <a href="https://stackoverflow.com/questions/894829/java-opinion-preventing-exceptions-vs-catching-exceptions">Preventing exceptions vs. catching exceptions in Java</a></p>