具有追加模式的Java FileWriter我目前正在使用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();
添加回答
舉報
0/150
提交
取消