What is the method used to clear the buffer

Showing Answers 1 - 6 of 6 Answers

BufferedWriter obj=new BufferedWriter(new FileWriter(new File("test.txt")));
obj.write("hai");    //after this without using flush if u close obj "hai" will not go to file
obj.flush();           //now only it goes to file because if we use buffers to write data to file obj.close();           //they will write the content to file only if the buffer is full or if we use //flush method to force the content to be written even if buffer is not full

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions