I have a filewriter that takes String data from the user and writes it on the file. But the filewriter replaces the already existing data in that file. How do I prevent it from doing it? I just want to keep adding information without writing over something.
Here is the code
String info = scan.nextLine();
File myFile = new File ("/home/greg/workspace/Mavericks/fred.txt");
FileWriter writer = new FileWriter (myFile);
writer.write(register);
writer.flush();
Thanks. I fixed that. Now I just want to make the writer write using spaces. When I write to the file it just keeps writing within the same line.