2013年6月29日

.NET:为什么需要逆变和协变

摘要: 为啥需要协变和逆变?我目前想到的理由是:逆变和协变的目的是支持多态。一个小例子不明白为啥输出的是false和true。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace InOutStudy 8 { 9 class Program10 {11 static void Main(string[] args)12 {13 ... 阅读全文

posted @ 2013-06-29 15:23 幸福框架 阅读(773) 评论(0) 推荐(0) 编辑

导航

我要啦免费统计