相关疑难解决方法(0)

为什么不能列出<parent> = List <child>?

为什么以下代码不起作用?

class parent {}
class kid:parent {}

List<parent> parents=new List<kid>;
Run Code Online (Sandbox Code Playgroud)

这对我来说似乎很明显.这里发生了什么?

.net c# oop inheritance

1
推荐指数
1
解决办法
4213
查看次数

标签 统计

.net ×1

c# ×1

inheritance ×1

oop ×1