为什么我的程序一遍又一遍地写入文件而不是添加数据?
我想写入文件,但它总是删除以前的并写入新的......
BufferedWriter writer = null;
try {
writer = new BufferedWriter(new FileWriter("koce_podatki.txt", true));
//WRITES 1 LINE TO FILE AND CHANGES LINE
writer.write(temp);
writer.newLine();
writer.close();
} catch (Exception e) {
}
try {
writer = new BufferedWriter(new FileWriter("s_koce.txt", true));
//WRITES 1 LINE TO FILE AND CHANGES LINE
writer.write(ime.getText());
writer.newLine();
writer.close();
} catch (Exception e) {
}