复制代码代码如下: BufferedWriter 输出 = null;尝试 { out = new BufferedWriter(new FileWriter(“文件名”, true)); out.write("aString"); } catch (IOException e) { // 错误处理代码} 最后 {如果(输出!=空){关闭(); } }