C#?????????????????
???????????? ???????[ 2013/10/10 15:46:05 ] ????????
????40. ????????????????????????????塣
????41. ??????y???
????42. ??????е???????????????2:1???????
????43. ???????????????????????
????44. ????????????а???3??5???????
????45. ????е???????ó???20????
????a) ???????????????12??
????46. ?????????а????????
????47. ??????ó?????????y???滻??
????48. ???????????????
????49. ?????????????????
????50. ????????????????????????
SomeType obj1;
IMyInterface obj2;
/* ???????д?????????obj1???????? */
obj2 = obj1 as IMyInterface;
if (obj2 != null)
{
obj2.Method1();
}
else
{
//???????
}
????51. ????????????????????????????????????????滻???
????52. ?????????????????????????????????????????????
????53. ??????????????????????????StringBuilder??????string
????54. ???????????????????
????a) ??????ò???????????
????b) ??????ò?????
????55. ???????????????????????????
????56. ???????????????ú??????
????57. ?????ó?????????????
????58. ????????????switch????з???????goto???
????59. ??switch????????????default???????????(Assert)??
int number = SomeMethod();
switch(number)
{
case 1:
Trace.WriteLine("Case 1:");
break;
case 2:
Trace.WriteLine("Case 2:");
break;
default :
Debug.Assert(false);
break;
}
????60. ????????????е?????????????????????this???
// ??????this??????
public class MyClass
{
public MyClass(string message )
{}
public MyClass() : this("hello")
{}
}
????61. ??????????д?????д?????????????????????????????????????base??????????????
// ??????base??????
public class Dog
{
public Dog(string name)
{}
virtual public void Bark( int howLong)
{}
}
public class GermanShepherd : Dog
{
public GermanShe pherd(string name): base (name)
{}
override public void Bark(int howLong)
{
base .Bark(howLong);
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11