如何写文件

try {
pw = new   PrintWriter(new   FileOutputStream("文件名"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}  
      
         pw.print(字符串);  
                                  
         pw.flush();

你可能感兴趣的:(program)