title: Is there a need to close resource if we use try-with-resource
body: <p>I am using try-with-resource block in my code, wondering is there a need to close the resource at the end of the method or not needed? </p>
  
  <pre><code>try (S3Object object = s3.getObject(new GetObjectRequest(bucketName, key));
    BufferedReader br = new BufferedReader(new InputStreamReader(object.getObjectContent()));
    BufferedWriter bw = new BufferedWriter(new FileWriter(new File("output.txt")))){
    String line;
  
    while((line=br.readLine())!=null){
      bw.write(line);
      bw.newLine();
      bw.flush();
    }
  }
  </code></pre>