System.setOut(ps)重定义了输出流后,如何重定向控制台输出

可以用
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
重新定位到标准输出流

原文地址:https://www.cnblogs.com/passer1991/p/3133945.html