click below
click below
Normal Size Small Size show me how
CSharp Study
CSharp Study (Mostly fix the code so it can compile)
| Question | Answer |
|---|---|
| DateTime today = DateTime("12/31/2007 12:15:00"); | DateTime today = DateTime.Parse("12/31/2007 12:15:00"); |
| var nums = new int{ 1, 2, 3 }; | var nums = new int[] { 1, 2, 3 }; |
| string[] names = {Fred, Sue, Barney}; | string[] names = {"Fred", "Sue", "Barney"}; |
| Create an interface called.. IAlarmClock | interface IAlarmClock { ... } |
| Extend the IAlarmClock interface to IClock | interface IAlarmClock : IClock { ... } |
| Have a WristWatch class implement IAlarmClock and ITimer. | class WristWatch : IAlarmClock, ITimer { ... } |