public interface Closeable extends AutoCloseable
Closeable
是源或数据,可以关闭的目的地。调用关闭方法以释放对象所持有的资源(如打开文件)。
void close() throws IOException
正如在AutoCloseable.close()
,其中近可能不需要注意。我们强烈建议放弃潜在的资源和内部标记Closeable
封闭,把IOException
之前。
close
接口
AutoCloseable
IOException
如果I/O错误发生
Submit a bug or feature
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.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.