C#-delegate
来源:互联网 发布:40本网络禁书本地下载 编辑:程序博客网 时间:2024/04/29 13:22
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace delegateDemo{ public delegate int NumberOperate(int x,int y); public class SimpleMath { public static int add(int x, int y) { return x + y; } public static int sub(int x, int y) { return x - y; } } class Program { static void Main(string[] args) { int a = 10, b = 20; NumberOperate numOp = new NumberOperate(SimpleMath.add); Console.WriteLine("{0}+{1}={2}",a,b,numOp(a,b)); numOp = new NumberOperate(SimpleMath.sub); Console.WriteLine("{0}-{1}={2}", a, b, numOp(a, b)); Console.ReadLine(); } }}
0 0
- C#-delegate
- C#-委托(delegate)
- C#-委托(delegate)
- delegate,C#,代理
- [C#] 委托delegate
- objective-c delegate
- objective-c - delegate
- Objective-C delegate理解
- objective-c - delegate
- objective-c delegate
- c#---delegate关键字
- c#delegate应用
- C#delegate案例
- c#delegate & event
- 【C#】delegate 和 event
- c#---delegate关键字
- C++/CLI Delegate
- c#---delegate关键字
- 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!
- 银行业务调度系统
- UCOS移植第一篇:os_cpu.c
- 基于rt-thread+lwip分析数据是怎么从网卡芯片接收数据到pbuf的(lwip源码解析一)
- ios 开发中跟绘图相关的CGFloat,CGPoint,CGSize,CGRect,CGRectZero
- C#-delegate
- 对Jscript操作注册表接口的一点不解
- [LinkedIn] Find the 100 most frequently occurring words in a set of documents.
- 插入排序
- C++ debug和release版本的区别及调试技巧
- UVA - 10700 - Camel trading (简单贪心)
- arm_day12
- 数组指针的疑惑
- arm_day13