Javatpoint Logo
Javatpoint Logo

Java OutputStream close() Method

The close() is used to close the output stream and releases any system resources attach with this stream. If the stream is already closed then invoking this method will have no effect.

Syntax

Specified By:

close in interface AutoCloseable

Specified By:

close in interface Closeable

Throws:

IOException: If an I/O error occurs.

Example

Output:

x
Next TopicJava OutputStream





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA