摘要:
在转换中使用了TInput和TOutput泛型类型.TInput是委托方法的参数.TOutput是返回类型.
我们现在把Racer类型转换为Person类型. 阅读全文
摘要:
从数据库中直接导出取道泛型里面. 阅读全文
摘要:
3.泛型排序
List类可以对其元素排序.Sort()方法有几个重载的版本:
public void List.Sort();
public void List.Sort(Comparison);
public void List.Sort(IComparer);
public void List.Sort(Int32,Int32,IComparer); 阅读全文
摘要:
System.Collections.Generic命名空间中的LIst类不使用对象,而是在使用时定义类型.
下面的例子中List类的泛型类型定义为int,所以int类型在JIT编译器动态生成的类中使用,不再进行装拆箱的操作: 阅读全文