Question: Which statements about try-with-resources are false? (Choose two.) A. If more than one resource is used, the resources are closed in the order they were
Which statements about try-with-resources are false? (Choose two.)
A. If more than one resource is used, the resources are closed in the order they were created.
B. Parentheses are used for the resource declaration section, even if more than one resource is used.
C. If the try block and close() method both throw an exception, then the one thrown by the close() method is suppressed.
D. A resource may be declared before it is used in a try-with-resources statement.
E. Resources declarations are separated by commas.
F. A catch block is not required.
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
The trywithresources statement is a feature introduced in Java 7 that allows you to declare resources to be used in a try block with the assurance that the resources will be closed when the execution of the block of code is over whether it completes normally or abruptly Among the options presented statements A and C are false A If more than one resource ... View full answer
Get step-by-step solutions from verified subject matter experts
