Turn System.out into a PrintWriter
// : 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 java.io.PrintWriter;
public class ChangeSystemOut {
public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.out, true);
out.println("Hello, world");
}
} ///:~
Related examples in the same category