Exam 1z0-816 All QuestionsBrowse all questions from this exam
Question 17

Given:

You want to use the myResource class in a try-with-resources statement.

Which change will accomplish this?

    Correct Answer: D

    To use the MyResource class in a try-with-resources statement, you must implement the AutoCloseable interface and override the close method. Implementing AutoCloseable ensures that MyResource can be used in the try-with-resources statement and properly closed at the end of the statement.

Discussion
Sa16253748596Option: D

D is true.