why overwriting the file in java?

This is for Scala, Python, core Java, java script, Struts, Jsp, Servlet, Spring, EJB etc. Programming Language and Framework
mina1234
Posts: 72
Joined: Tue May 05, 2015 7:08 pm
Contact:

why overwriting the file in java?

Postby mina1234 » Thu Oct 01, 2015 8:11 pm

Hi I have used java code to write in file.
The issue is I am not able to append the next line in file. Every time it is overwriting the file in java.

why it is overwriting the file in java? I used below code:

Code: Select all

FileWriter fw = new FileWriter(file);
           BufferedWriter bw = null;
      
           bw = new BufferedWriter(fw);
           bw.write(finalOutput);
           bw.newLine();
           bw.close();


Return to “Core Java, Scala, Python and Advanced Programming or development”

Who is online

Users browsing this forum: No registered users and 2 guests