日期:2014-05-20 浏览次数:20832 次
PrintWriter out = new PrintWriter(new File("c:/log.txt"));
System.setOut(out );
try {
System.out.println(“abv”);
}
} catch (DocumentException e) {
System.out.println(e.printStackTrace());
}
out.flush();
out.close();
------解决方案--------------------
PrintStreamout = new PrintStream(new File("路径"));