java向文件末尾添加内容示例分享
程序员文章站
2024-02-20 23:58:22
复制代码 代码如下:bufferedwriter out = null; try { ...
复制代码 代码如下:
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();
}
}