1.

What is the difference between AutoCloseable and Closeable?(a) Closeable is an interface and AutoCloseable is a concrete class(b) Closeable throws IOException; AutoCloseable throws Exception(c) Closeable is a concept; AutoCloseable is an implementation(d) Closeable throws Exception; AutoCloseable throws IOException

Answer» The correct option is (b) Closeable throws IOException; AutoCloseable throws Exception

Explanation: Closeable extends AutoCloseable and both are interfaces. Closeable throws IOException and AutoCloseable throws Exception.


Discussion

No Comment Found

Related InterviewSolutions