Question: Which statement best describes how a class that implements the AutoCloseable interface should be written? (Choose two.) A. The close() method is optional since the
Which statement best describes how a class that implements the AutoCloseable interface should be written? (Choose two.)
A. The close() method is optional since the AutoCloseable interface defines a default implementation.
B. The close() method should avoid modifying data after it has been run once.
C. The close() method should not throw any exceptions.
D. The close() method should throw an exception if there is a problem closing the resource.
E. The close() method should return a status code.
Step by Step Solution
3.26 Rating (161 Votes )
There are 3 Steps involved in it
The correct answers are B The close method should avoid modifying data after it has been run once D ... View full answer
Get step-by-step solutions from verified subject matter experts
