Problem Statement
In try-with-resources, where do exceptions thrown during close() appear?
Explanation
If both the try body and close() throw, the try body’s exception is primary, and close() exceptions are attached as suppressed, retrievable via getSuppressed().
Practice Sets
This question appears in the following practice sets: