标签:www. close file void nal flush www not res
http://www.verejava.com/?id=16994706165617
package com.printstream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class TestPrintWriter
{
public static void main(String[] args)
{
PrintWriter pw=null;
try
{
pw=new PrintWriter(new FileWriter(new File("res/printwriter.txt"),true));
pw.println(true);
pw.println(20);
pw.println("黎明");
pw.flush();
} catch (FileNotFoundException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
finally
{
pw.close();
}
}
}
http://www.verejava.com/?id=16994706165617
标签:www. close file void nal flush www not res
原文地址:https://www.cnblogs.com/verejava/p/9227222.html