字符输出流 FileWriter

FileWriter  方法: writer();
                          flush();
package cn.lideng.demo3;

import java.io.FileWriter;
import java.io.IOException;

public class WriterDemo {
    public static void main(String[] args) throws IOException {
        FileWriter fw=new FileWriter("d:\\b.txt");
        
        fw.write(100);
        fw.write(101);
        char[] c={'a','b','c','d'};
        fw.write(c);
        fw.write(c,1,2);
        fw.write("qy97威武");
        fw.flush();
        fw.close();
    }
}

 

posted @ 2019-03-25 20:07  芯-觞  阅读(117)  评论(0编辑  收藏  举报