我有一个如下声明的列表:
List<? extends Number> foo3 = new ArrayList<Integer>();
我尝试将3加到foo3中。但是,我得到如下的错误消息:
The method add(capture#1-of ? extends Number) in the type List<capture#1-of ?
extends Number> is not applicable for the arguments (ExtendsNumber)
https://stackoverflow.com/questions/2776975
复制相似问题