
public class PrintSpooler {
    //a prototype for a spooler class
    //such that only one instance can ever exist
    private static PrintSpooler spooler;

    private PrintSpooler() {    //privatized
    }

    public static synchronized PrintSpooler getSpooler() {
        if (spooler == null)
            spooler =  new PrintSpooler();
        return spooler;
    }

    public void print(String s) {
        System.out.println(s);
    }
}
