阅读背景:

Item 28: Prefer lists to arrays(list 优于数组)

来源:互联网 

Arrays differ from generic types in two important ways. First, arrays are covariant. This scary-sounding word means simply that if Sub is a subtype of Super, then the array type Sub[] is a subtype of the array type Super[]. Generics, by contrast, are invariant: for any two distinct types Type1 and Type2, Arrays differ from generic types in




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: