src/ThreadPrintStream.java
public static void replaceSystemOut() {

        // Save the existing System.out
        PrintStream console = System.out;

        // Create a ThreadPrintStream and install it as System.out
        ThreadPrintStream threadOut = new ThreadPrintStream();
        System.setOut(threadOut);

        // Use the original System.out as the current thread's System.out
        threadOut.setThreadOut(console);
    }
/** Changes System.out to a ThreadPrintStream which will
     * send output to a separate streem for each thread. */
Changes System.out to a ThreadPrintStream which will
send output to a separate streem for each thread.
Changes System . out to a ThreadPrintStream which will send output to a separate streem for each thread .
public static void replaceSystemOut() {
        PrintStream console = System.out;
        ThreadPrintStream threadOut = new ThreadPrintStream();
        System.setOut(threadOut);
        threadOut.setThreadOut(console);
    }
public static void replaceSystemOut ( ) { PrintStream console = System . out ; ThreadPrintStream threadOut = new ThreadPrintStream ( ) ; System . setOut ( threadOut ) ; threadOut . setThreadOut ( console ) ; }
Changes System.out to a ThreadPrintStream which will
 send output to a separate streem for each thread.
Changes System . out to a ThreadPrintStream which will send output to a separate streem for each thread .
// Save the existing System.out // Create a ThreadPrintStream and install it as System.out // Use the original System.out as the current thread's System.out