Difference between close and Flush | Selenium Forum
M
Posted on 28/01/2016
What is the difference between close() and Flush().
I have googled for the answer but did not get the satisfactory answer can you explain me with simple and plain example .


thank u

M
Replied on 28/01/2016

do you mean close() and flush()?or close() and quit()


M
Replied on 02/02/2016

I mean flush() and close() ?


M
Replied on 02/02/2016

Flush() is a java function which is used to write files.

close() is a selenium webdriver function which closes the web browser they have nothing in common.


M
Replied on 04/02/2016

While i invoke bufferewriter,say for example,..

Bufferewriter bw =new BufferedWriter(new FileWriter(fw));
bw.write("Hello");


now this is will work only if I write bw.flush() or bw.close() . i have done this practically .
Now what is the difference between this two functions.


M
Replied on 04/02/2016

call write() and then flush() (to avoid content loss/flush the characters to the intended stream).

close() (used to releases any system resources associated with the stream)