学习委托
简单实例 1 public class test
2 {
3 public deledate void MenuHandler(string username);
4 public void MenuHandlershixian(string username)
5 {
6 response.write(username);
7 }
8 public void show()
9 {
10 MenuHandler mh=MenuHandlershixian;
11 mh("majuan");
12 }
13 public static void main()
14 {
15 show();
16 }
17
18 } MenuHandler mh=new MenuHandler(this.MenuHandlershixian); 和 MenuHandler mh=this.MenuHandlershixian; 作用是一样的 都是获得此方法的委托实例
转载于:https://www.cnblogs.com/mmbbflyer/archive/2009/12/16/1625709.html
总结
- 上一篇: “哀音遶梁作”上一句是什么
- 下一篇: 游戏需求分析