system.out.println重定向

来源:互联网 发布:xshell mac 破解版 编辑:程序博客网 时间:2024/05/09 14:11
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);
原创粉丝点击