站长统计我要啦免费统计
摘要: 4、为什么支持协变的参数只能用于方法的返回值?支持逆变的参数只能用于方法参数?“TParent不能安全转换成TSub”,是这两个问题的共同原因。我们定义一个接口IFoo。interfaceIFoo{voidMethod1(Tparam);TMethod2();}我们看一下协变的过程:IFoo转换成I... 阅读全文
posted @ 2015-05-29 15:33 笑笑91919 阅读(209) 评论(0) 推荐(0) 编辑
摘要: // 委托声明 -- 定义一个签名:delegate double MathAction(double num);class DelegateTest{ // 符合委托声明的常规方法 static double Double(double input) { retur... 阅读全文
posted @ 2015-05-29 15:03 笑笑91919 阅读(130) 评论(0) 推荐(0) 编辑