Package java.lang
Interface AutoCloseable
-
- All Known Subinterfaces:
Closeable
- All Known Implementing Classes:
DummyInputStream,DummyOutputStream,FlinkUARTInputStream,FlinkUARTOutputStream,InputStream,OutputStream,PrintStream,SCIInputStream,SCIOutputStream,UARTInputStream,UARTInputStream,UARTOutputStream,UARTOutputStream,UARTOutputStream
public interface AutoCloseableDefines an interface for classes that can (or need to) be closed once they are not used any longer. Calling theclosemethod releases resources that the object holds.A common pattern for using an
AutoCloseableresource:Closable foo = new Foo(); try { ...; } finally { foo.close(); }- Since:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes the object and release any system resources it holds.
-