Ejemplo n.º 1
0
        Cloneable Cloneable.cloneAnimal(Cloneable animal)
        {
            animal = new Sheep();
            animal.setCloneName("Dolly");

            return(animal);
        }
Ejemplo n.º 2
0
        static void sheep()
        {
            Cloneable sheep = new Sheep();

            Console.Write("\nCounting Sheep...\n\n");

            CountUtil.count(sheep, 2);

            Console.Write("\n");

            Cloneable sheepClone = sheep.cloneAnimal(sheep);

            CountUtil.count(sheepClone, 3);

            Console.Write("\n");

            sheep.resetCount();
            CountUtil.count(sheep, 1);
        }