예제 #1
0
        static void Main(string[] args)
        {

            var fish = new Fish(new Animal(), new Swimmable());

            var animal = new Animal();
            var walk = new Walkable();
            var dog = new Dog(animal, walk);
            var type = dog.GetType();
            dog.Age = 12;
            dog.Walk(type);
            Console.WriteLine(dog.Age);
            fish.Swim(fish.GetType());

        }
예제 #2
0
 public Dog(Animal animal, Walkable walkable)
 {
     _animal = animal;
     _walkabel = walkable;
   
 }