difference between flush and close function in case of filewriter in java

前端 未结 5 979
傲寒
傲寒 2020-12-04 11:56

I need to know what is exact difference between flush and close function in Java?

And When the data is dumped into a file during writing of file?

Please prov

5条回答
  •  再見小時候
    2020-12-04 12:43

    flush() flushes content of buffer to destination.And you can write something again into the stream.close() flushes content to destination and closes the stream. After close() you can't write anything anymore.

提交回复
热议问题