首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

<T extends Comparable< super T>>该怎么解决

2012-10-09 
T extends Comparable? super TT extends Comparable? super T这里的什么意思,限制什么? super T

<T extends Comparable<? super T>>
<T extends Comparable<? super T>>
这里的什么意思,限制什么
? super T 有什么用

[解决办法]
? super T 语法将泛型类限制为所有T的超类(包括T自身)
T extends Comparable T为Comparable的子类
[解决办法]

探讨

(List<? super Apple> apples)
我想问的是? super Apple代表下界
是代表参数可为Apple的超类,还是Apple的子类

热点排行