摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace 阅读全文
摘要:
where 子句用于指定类型约束,这些约束可以作为泛型声明中定义的类型参数的变量。 1.接口约束。 例如,可以声明一个泛型类 MyGenericClass,这样,类型参数 T 就可以实现 IComparable<T> 接口: public class MyGenericClass<T> where 阅读全文