public void Dispaly() { Console.WriteLine("I am a " + Name); AHead.Display(); foreach (Leg aleg in Legs) { aleg.Display(); } ATail.Display(); Console.WriteLine(); }
//Helper method to show the result from client public List <string> Show() { List <string> list = new List <string>(); list.Add("It is " + Name); list.Add(AHead.Show()); foreach (Leg aleg in Legs) { list.Add(aleg.Show()); } list.Add(ATail.Show()); return(list); }