1
2File file = new File("append.txt");
3FileWriter fr = new FileWriter(file, true);
4BufferedWriter br = new BufferedWriter(fr);
5PrintWriter pr = new PrintWriter(br);
6pr.println("data");
7pr.close();
8br.close();
9fr.close();
10
1
2File file = new File("append.txt");
3FileWriter fr = new FileWriter(file, true);
4BufferedWriter br = new BufferedWriter(fr);
5br.write("data");
6
7br.close();
8fr.close();
9
1
2File file = new File("append.txt");
3FileWriter fr = new FileWriter(file, true); // parameter 'true' is for append mode
4fr.write("data");
5fr.close();
6
1
2File file = new File("append.txt");
3FileWriter fr = new FileWriter(file, true);
4fr.write("data");
5fr.close();
6