Exemplo n.º 1
0
        static void Main(string[] args)
        {
            PrinterCreater printerCreater = null;

            printerCreater = new Canon("Canon");
            printerCreater.PrintMethod();

            printerCreater = new HP("HP");
            printerCreater.PrintMethod();


            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Printer printer = new Canon("принтер Canon");
            Paper   paper1  = printer.Create();

            printer.Print(paper1.Type);

            printer = new HP("принтер HP");
            Paper paper2 = printer.Create();

            printer.Print(paper2.Type);

            Console.ReadLine();
        }