See the Javadoc of the
AutoCloseable and
Closeable interfaces for a list of classes that implement either of these interfaces. The
Closeable interface extends the
AutoCloseable interface. The
close method of the
Closeable interface throws exceptions of type
IOException while the
close method of the
AutoCloseable interface throws exceptions of type
Exception. Consequently, subclasses of the
AutoCloseable interface can override this behavior of the
close method to throw specialized exceptions, such as
IOException, or no exception at all.
No comments:
Post a Comment