方法一
PrintWriter pr = new PrintWriter("abc.txt");
pr.println("ddd");
pr.println("ddd");
pr.println("ddd");
pr.println("ddd");
pr.close();
方法二
BufferedWriter bw = new BufferedWriter(new FileWriter("abc.txt",true));
bw.write("tttuu");
bw.close();