title: Why does order matter when catching exceptions?
body: <p>I had to answer this question with some code:</p>
  
  <blockquote>
    <p>Suppose I wrote the following method specification:<br>
    <strong><code>public void manipulateData ( ) throws java.sql.SQLException, java.sql.SQLDataException</code></strong>   </p>
    
    <p>You are writing code for a database
    program that will use this method and you want to handle each
    specifically. <strong>What should the try/catch clause look like?</strong><br>
    You can use no-ops-- empty blocks {}--for the catch clause contents.<br>
    We are only interested in the syntax and structure of the statements here.</p>
  </blockquote>
  
  <p>I answered with this:</p>
  
  <pre><code>try {
  
  } catch(java.sql.SQLException e) {
  
  }
  catch(java.sql.SQLDataException e) {
  
  }
  </code></pre>
  
  <p>He did not accept the answer for this reason:</p>
  
  <p>"Your catch clauses are in the wrong order. Can you explain why the order matters?"</p>
  
  <p>Is he correct in his answer? </p>