 <p>Close the resources in a <code>finally</code> block, not in a <code>catch</code> block.</p> <pre><code> try { // actual code. } catch (IOException e) { // handle exception } finally { try { in.close(); } catch (IOException e) { // handle exception } } </code></pre>