Java添加文本字符串到文本文件,代码带有try语句保护
BufferedWriter out = null; try { // code from http://www.75271.com/codes/ out = new BufferedWriter(new FileWriter(”filename”, true)); out.write(”aString”); } catch (IOException e) { // error processing code } finally { if (out != null) { out.close(); } }