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.
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.
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)