예제 #1
0
파일: Sheep.cs 프로젝트: a-let/lab_thirteen
        Cloneable Cloneable.cloneAnimal(Cloneable animal)
        {
            animal = new Sheep();
            animal.setCloneName("Dolly");

            return(animal);
        }
예제 #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);
        }