class A where T:new() – 鷇音子 – 博客园 来源: class A where T:new() - 鷇音子 - 博客园 class A<T> where T:new() 这是类型参数约束,where表名了对类型变量T的约束关系。where T:A 表示类型变量是继承于A的,或者是A本省。where T: new()指明了创建T的实例应该使用的构造函数。 .NET支持的类型参数约束有以下五种: where T: struct C# mikel 2020-07-07 67 热度 0评论