向一个文本文件中写内容时的换行问题
程序代码如下
String content = "It is just a test \n";
FileWriter tofile;
BufferedWriter bfw;
try{
tofile=new FileWriter("C:\\test.txt");
bfw = new BufferedWriter(tofile);
bfw.write(content,0,content.length());
bfw.flush();
}
catch(FileNotFoundException e){System.err.println(e);}
catch(IOException e){System.err.println(e);}
请问怎么做才能做到每次向 C:\TEST.TXT 文件里写内容的时候可以接着写
例如:
It is just a test
It is just a test
It is just a test
... ... ...