Esempio n. 1
0
        private static Object Criar()
        {
            int x = new Random().Next(1, 5);

            Object retorno = new Etiquetadora();

            switch (x)
            {
            case 1: retorno = new Monitor(); break;

            case 2: retorno = new Impressora(); break;
            }

            return(retorno);
        }
Esempio n. 2
0
        private static Object Criar()
        {
            int x = new Random().Next(1, 5);

            Object retorno = new Etiquetadora();

            switch (x)
            {

                case 1: retorno = new Monitor(); break;
                case 2: retorno = new Impressora(); break;

            }

            return retorno;
        }