title: 'try with resource' feature for File class
body: <p>I have one scenario where I am trying to implement with the Java 7 'try with resource' feature. </p>
  
  <p>My finally block contains an object of <code>BufferedWriter</code> and <code>File</code>, which I want to close using 'try with resource' feature, instead of closing it by calling close method explicitly. </p>
  
  <p>But I checked on net and saw that the <code>File</code> class does not implement the <code>AutoCloseable</code> interface, but <code>BufferedWriter</code> does. So how can I manage this scenario to implement 'try with resource' feature?                    </p>