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 AutoCloseable
Defines an interface for classes that can (or need to) be closed once they are not used any longer. Calling theclose
method releases resources that the object holds.A common pattern for using an
AutoCloseable
resource:Closable foo = new Foo(); try { ...; } finally { foo.close(); }
- Since:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes the object and release any system resources it holds.
-