title: Why close() method in java are throwing exception?
body: <p>really stupid question but maybe somebody has a smart answer :</p>
  
  <p>why close() methods in Java throw exceptions ?</p>
  
  <p>in my opinion close() is the final method you call in some kind of logic so it should not fail, even if it fails something it should be treated in the Class and not throw the Exception.</p>
  
  <p>thanks ALL</p>
  
  <p>PS : mostly the question is about object design and development approach (not implementation specific)</p>
  
  <p>now you probably are right that this makes sense, but how to write nicely this kind of code:</p>
  
  <pre><code>try {
  } catch (Exception e) {
      logger.error("Error occured during copy", e);
  } finally {
      // close all objects
      try {
          connection.close();
      } catch ( ... ) {
          ...
      } finally {
          ...
      }
  }
  </code></pre>
  
  <p>thanks.</p>