Which statement best describes how a class that implements the AutoCloseable interface should be written? (Choose two.)

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 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: