焱下川 发表于 2013-2-3 14:15:17

List<? extends Number> list和List<Number>的区别

If wanting a List that can store objects of all subclasses of Number, you can just use List<Number>.

That is not the same as List<? extends Number>, which is a List whose members can only be a specific subclass of Number.

(When I say "subclass of Number", I include Number itself ... obviously?)
 
 
 
 
http://www.coderanch.com/t/383399/Java-General/java/use-add-method-List-extends
 
页: [1]
查看完整版本: List<? extends Number> list和List<Number>的区别