我目前使用FileWriter
來創建並寫入文件。每次我都可以寫入同一個文件而不刪除那裏的內容嗎?帶追加模式的Java FileWriter
fout = new FileWriter(
"Distribution_" + Double.toString(_lowerBound) + "_" + Double.toString(_highBound) + ".txt");
fileout = new PrintWriter(fout,true);
fileout.print(now.getTime().toString() + ", " + weight + ","+ count +"\n");
fileout.close();
java doc已移動 – 2015-01-27 15:13:25
2015年仍可使用 – 2015-08-15 07:40:07