adplus-dvertising
frame-decoration

Question

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

Posted under Java Programming

Answer: (b).Closeable throws IOException; AutoCloseable throws Exception

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the difference between AutoCloseable and Closeable?

Similar Questions

Discover Related MCQs

Q. It is a good practise to not throw which exception in close() method of autocloseable?

Q. Which of the below is a child interface of Autocloseable?

Q. What is the alternative of using finally to close resource?

Q. Autocloseable was introduced in which Java version?

Q. What does foo.getClass().getMethod(“doSomething”, null) return?

Q. What does Class.forName(“myreflection.Foo”).getInstance() return?

Q. How to get the class object of associated class using Reflection?

Q. How method can be invoked on unknown object?

Q. What is used to get class name in reflection?

Q. How private field can be called using reflection?

Q. How private method can be called using reflection?

Q. What is not the advantage of Reflection?

Q. Which of the following is not a marker interface?

Q. What are the components of a marker interface?

Q. Which of the following is not a directive in JSP?

Q. Java code is embedded under which tag in JSP?

Q. Can <!–comment–> and <%–comment–%> be used alternatively in JSP?

Q. Which tag is used to set a value of a JavaBean?

Q. What temporarily redirects response to the browser?

Q. Which object stores references to the request and response objects?