现在的位置: 首页 > 综合 > 正文

system.out.println重定向

2018年02月04日 ⁄ 综合 ⁄ 共 176字 ⁄ 字号 评论关闭

File file = new File("c:/a.txt");
PrintStream fi = null;
try {
fi = new PrintStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

System.setOut(fi);

抱歉!评论已关闭.