java.lang
public interface AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this resource, relinquishing any underlying resources.
|
void close()
throws Exception
try-with-resources statement.
Classes implementing this method are strongly encouraged to be declared to throw more specific exceptions (or no exception at all, if the close cannot fail).
Note that unlike the close
method of Closeable, this close method
is not required to be idempotent. In other words,
calling this close method more than once may have some
visible side effect, unlike Closeable.close which is
required to have no effect if called more than once.
Exception - if this resource cannot be closed Submit a bug or feature Copyright © 1993, 2010, Oracle Corporation. All rights reserved.
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
DRAFT ea-b123