title: Java: Exceptions
body: <p>Why is this code correct:</p>
  
  <pre><code>try {
  
  } catch(ArrayOutOfBoundsException e) {}
  </code></pre>
  
  <p>and this wrong:</p>
  
  <pre><code>try {
  
  } catch(IOException e) {}
  </code></pre>
  
  <p>This code is wrong because in the <code>try</code>-body never an <code>IOException</code> is thrown, but in the first body there is also never throw a <code>ArrayOutOfBoundsException</code>. And the first code-piece is correct. Why?? Can I make my own exceptions also like <code>IOException</code> (Must be thrown before catching)?</p>