例子:
import java.io.*;
import java.util.*;
public class Application1{
public static void main(String[] args){
try{
PrintWriter pw=new PrintWriter(new FileOutputStream("Answer.txt"));
String line="汉字";
pw.println(line);
pw.flush();
}
catch(IOException e){e.toString();}
}
}
在同目录下建文本文件Answer.txtTop