应用实例
//演示BufferedWriter的使用
public class BufferedWriter_ {
public static void main(String[] args) throws IOException{
String filePath = "d:\\a.txt";
//创建BufferedWriter对象
/**
* 说明
* 1.new FileWriter(filePath,true)表示以追加的方式写入
* 2.new FileWriter(filePath)表示以覆盖的方式写入
*/
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath));
bufferedWriter.newLine();//插入一个和系统相关的换行符
bufferedWriter.close();
}
}
标签:String,filePath,处理,bufferedWriter,BufferedWriter,FileWriter,new
From: https://www.cnblogs.com/cyyyds/p/17065393.html