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(); }
public void AddCat(Cat cat) { Cats.Add(cat); }