- 博客(3)
- 收藏
- 关注
原创 C#委托、事件、自定义事件的理解
一、委托委托类似于函数指针,但函数指针只能引用静态方法,而委托既能引用静态方法,也能引用实例方法。委托使用分三步:1、委托声明。2、委托实例化。3、委托调用。例程一:using System;namespace 委托{ delegate int NumOpe(int a,int b); //委托声明 class Class1 { static void Main(string[]
2006-02-19 23:11:00
2498
1
转载 ref和out 转贴
首先,如果不使用这两个关键字,那是什么样 呢?看下面的例子:using System; class Test { static void Swap(ref int x, ref int y) { int temp = x; x = y; y = temp; } static
2006-02-13 14:59:00
1465
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅