What is the difference between flush and close in java filewriter:
flush() writes the contents of the buffer to the destination and makes the buffer empty for further data to store but it does not close the stream permanently. This means we can still write some more data to the stream.
Whereas close() closes the stream permanently. If you want to write some additional data, then you have to re-open the stream and append the data with the existing one.
Tags: flush and close in java
This article has been published by Chandra Sekhar. If you like selenium99 website and want to contribute any articles then please share your articles at firstname.lastname@example.org