We would like to know how to turn System.out into a PrintWriter.
import java.io.PrintWriter; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out, true); out.println("Hello, world"); } }
The code above generates the following result.