当前位置: 代码迷 >> J2SE >> java中怎的把中文字符串写入到文本文档中
  详细解决方案

java中怎的把中文字符串写入到文本文档中

热度:174   发布时间:2016-04-24 15:24:20.0
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);