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(); } }