public void GSMWithAllDetails() { Display someDisplay = new Display(45000,new DisplaySize(1024,768)); Battery superBattery = new Battery("kon",1000,1000,BatteryType.NiMH); GSM megaPhone = new GSM("Super Phone", "Krypton", 750,someDisplay,superBattery); Console.WriteLine(megaPhone); }
public GSM(string model, string manufacturer, string owner, double?price, Battery battery) : this(model, manufacturer, owner, price, battery, new Display()) { }
//a copy constructor - creates a new object, instead of using the reference to the old one public Battery(Battery oldBattery) : this(oldBattery.Model, oldBattery.HoursIdle, oldBattery.HoursTalk) { }