static void Main(string[] args) { Size toyS = new Size(20, 20); Toy car = new Toy(toyS, Color.Black); Child myChild = new Child(car); Adult myADult = new Adult(false); List<Person> list = new List<Person>(); list.Add(myADult); list.Add(myChild); foreach (var item in list) { Console.WriteLine(item.ToString()); item.DailyStuff(); } }
public Child(Toy toy):base(new Gender()) { this.toy = toy; }