I would like to know how to continue to write to a file without erasing the old contents. I just want to append to new data the data that already exists in the file.
Printable View
I would like to know how to continue to write to a file without erasing the old contents. I just want to append to new data the data that already exists in the file.
Use FileWriter class.
public FileWriter(String fileName,
boolean append) throws IOException
if the boolean is true , then the file will be opend in append mode.