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

1 Expert Approved Answer
Step: 1 Unlock

The correct answers are B The close method should avoid modifying data after it has been run once D ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Oracle Questions!