日期:2014-05-20  浏览次数:20737 次

java中怎样把中文字符串写入到文本文档中
String   text= "中文字符串 ";
File   file;
String   fileurl= "c;\\temp.txt ";
file   =   new   File(fileurl);
请问怎样把字符串text写到temp.txt文本文档中?

------解决方案--------------------
PrintStream ps = new PrintStream(new FileOutputStream(file);
ps.println(text);