示例#1
0
        static void Main(string[] args)
        {

            Animal animal = new Animal();
            animal.IsAlive = true;
            animal.Name = "Matti";
            animal.Age = 7;

            Cat cat = new Cat();
            cat.Bell = false;
            cat.Stripes = false;

            animal.AddCat(cat);
            animal.AddCat(cat);
            Console.WriteLine(animal.ToString());

          //  cat.PrintData();
     
        }
示例#2
0
 public void AddCat(Cat cat)
 {
     Cats.Add(cat);
 }