Hi Brij,
I also checked by writing on close() method then also it write the data into the given file. It means it is also performing some sort of flush() function before closing
No close dont perform any flush operation.
Nothing of this sort has been written in JLS
about close function.
flush operation make sure that if there is anything in the buffer, it gets flushed to the file.
But this does not mean if we will not use flush() function, then content will not get written to the file.
Need correction, if my understanding is wrong.