static void Main(string[] args) { PrintPool obj = PrintPool.getInstance(); obj.printMsg("doc_1"); PrintPool obj1 = PrintPool.getInstance(); obj1.printMsg("doc_2"); }
public static PrintPool getInstance() { if(instance==null) { instance = new PrintPool(); } return instance; }