package Zjshuchu; import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException; public class Demo01 {
//字符缓冲输出流
public static void main(String[] args) throws IOException {
//1、确定目的地
FileWriter fw=new FileWriter("d:\\java\\writer.txt",true);
//2.封装为缓冲流
BufferedWriter bw=new BufferedWriter(fw);
//3、写入数据
bw.write("你好吗");
bw.newLine();//换行
bw.flush();
bw.write("我好吗");
bw.newLine();//换行
bw.flush();
//4、释放资源
bw.close();
} }