Question: Which statements about try-with-resources are true? (Choose two.) A. Any resource used must implement Closeable. B. If more than one resource is used, then the
Which statements about try-with-resources are true? (Choose two.)
A. Any resource used must implement Closeable.
B. If more than one resource is used, then the order in which they are closed is the reverse of the order in which they were created.
C. If the try block and close() method both throw an exception, the one thrown by the try block is suppressed.
D. Neither a catch nor a finally block is required.
E. The close() method of the resources must throw a checked exception.
Step by Step Solution
3.48 Rating (165 Votes )
There are 3 Steps involved in it
The trywithresources statement is a try statement that declares one or more resources A resource is ... View full answer
Get step-by-step solutions from verified subject matter experts
