我看到了这个代码示例,并想知道new()约束的目的是什么:
new()
public class Client<T> : IClient where T : IClientFactory, new() { public Client(int UserID){ } }
c# oop polymorphism inheritance class
c# ×1
class ×1
inheritance ×1
oop ×1
polymorphism ×1