InterviewSolution
Saved Bookmarks
| 1. |
What is the alternative of using finally to close resource?(a) catch block(b) autocloseable interface to be implemented(c) try block(d) throw ExceptionI have been asked this question in my homework.I'd like to ask this question from AutoCloseable, Closeable and Flushable Interfaces topic in division Session Management, JSP & API of Java |
|
Answer» RIGHT option is (B) autocloseable interface to be implemented The best EXPLANATION: Autocloseable interface provides close() method to close this resource and any other UNDERLYING RESOURCES. |
|