package spikes; 

import java.io.PrintWriter;
import java.io.Writer;

/**
 *
 * @author jdalbey
 */
public class StdOutDemo
{

    private PrintWriter display;

    /**
     * Constructor.
     */
    public StdOutDemo()
    {
        display = new PrintWriter(System.out, true);
    }

    public void setWriter(Writer writer)
    {
        display = new PrintWriter(writer, true);
    }

    public void setVisible(boolean state)
    {
        display.print("--- Hello World ---\n");
        display.println("Time to print to System.out.");
    }

    public static void main(String[] args)
    {
        (new StdOutDemo()).setVisible(true);
    }
}
