Why do we use try-with-resources in a program?

Why do we use try-with-resources in a program?

From the BUET MSC (CSE) May 2019 – Written exam, question 2 of 16.

More from this paper