static void Main(string[] args) { // Create tyre Tyre tyre1 = new Tyre { Name = "Nokia", Model = "Hakka", Size = "205R16" }; Tyre tyre2 = new Tyre { Name = "Nokia", Model = "Hakka", Size = "225R16" }; // Create a car Vehicle car = new Vehicle { Name = "Porsche", Model = "911" }; car.AddTyre(tyre1); // Car contains tyres.. car.AddTyre(tyre1); // Car contains tyres.. car.AddTyre(tyre2); // Car contains tyres.. car.AddTyre(tyre2); // Car contains tyres.. Console.WriteLine(car.ToString()); }
public void AddTyre(Tyre tyre) { Tyres.Add(tyre); }