Problem Statement
What is required for a type to be used in try-with-resources?
Explanation
try-with-resources auto-closes resources that implement AutoCloseable (or Closeable which extends it). This ensures deterministic cleanup even when exceptions occur.
Practice Sets
This question appears in the following practice sets: