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:
Related Book For
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests Exam 1Z0 819 And Upgrade Exam 1Z0 817
ISBN: 9781119696131
1st Edition
Authors: Scott Selikoff, Jeanne Boyarsky
Question Posted: