changesystemout.java
来自「Thinking in Java第三版书中的源代码」· Java 代码 · 共 18 行
JAVA
18 行
//: c12:ChangeSystemOut.java
// Turn System.out into a PrintWriter.
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
import com.bruceeckel.simpletest.*;
import java.io.*;
public class ChangeSystemOut {
private static Test monitor = new Test();
public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.out, true);
out.println("Hello, world");
monitor.expect(new String[] {
"Hello, world"
});
}
} ///:~
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?