how to overwrite a file in java code example
Example 1: rewrite file java
Writer fileWriter = new FileWriter("c:\\data\\output.txt", true); //appends to file
Writer fileWriter = new FileWriter("c:\\data\\output.txt", false); //overwrites file
Example 2: filewriter java overwrite
import java.io.*;
FileWriter fwriter = new Filewriter("filename.txt" , true) //true for append, false for overwrite