TOP*_*KEK -3 inheritance covariance
假设我们有类层次结构Object<- String<-Username哪个类会派生得更多,哪个派生得少?
Object
String
Username
如果我声明接口像
interface IValidationRule<in T>
而我的T就是String这是否意味着我将能够使用Username, 但不能使用Object或以其他方式使用?
T
nvo*_*igt 5
假设Object是基类,从它派生的任何东西(在右边列出)都可以被认为是“更派生的”。
归档时间:
11 年,11 月 前
查看次数:
1621 次
最近记录: