public class A {} public class B : A {}
现在有什么最好的方法让这个工作
List<A> a; List<B> b = new List<B>(); a = b; // throw Cannot convert List<B> to List<A>
谢谢
c# generics polymorphism inheritance
c# ×1
generics ×1
inheritance ×1
polymorphism ×1