java.io 
Class FileWriter
java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.OutputStreamWriter
              |
              +--java.io.FileWriterpublic class FileWriterConvenience class for writing character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream. java.io 
Class PrintWriter
java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriterpublic class PrintWriterPrint formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams. 
写文件用前者比较合适吧.