当前位置: 编程技术>java/j2ee
java向文件末尾添加内容示例分享
来源: 互联网 发布时间:2014-10-31
本文导语: 代码如下:BufferedWriter out = null; try { out = new BufferedWriter(new FileWriter(”filename”, true)); out.write("aString"); } catch (IOException e) { // error processing code } finally { if (out != null) { out.clos...
代码如下:
BufferedWriter out = null;
try {
out = new BufferedWriter(new FileWriter(”filename”, true));
out.write("aString");
} catch (IOException e) {
// error processing code
} finally {
if (out != null) {
out.close();
}
}