日期:2014-05-20 浏览次数:20874 次
import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStreamWriter; public class Test { public static void main(String[] args) throws Exception { String s = "Hello World"; char[] c = s.toCharArray(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("D:\\d.txt"))); bw.write(c); bw.close(); } }