java泛型中

(1)<? super String> is any class which is a superclass of String (including String itself). (In this case, the only other suitable class is Object.)

即包括String的父類和它本身的類。

(2) <? extends String> (which in this specific case wouldn't be very useful as String is final, so it can have no subclasses).

即包括String的子類,而String沒有子類,爲null。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章