关于system.out
我把System.out 设为一个文件输入流,然后我想把它设回来System.setout(System.out)好像不成功,大神求解。
OutputStream o = new ByteArrayOutputStream(); PrintStream out = new PrintStream(o); PrintStream obak = System.out; System.setOut(out); System.out.println("out something"); System.setOut(obak); System.out.println("other");