Java集合中addAll(..)方法的正确参数类型是什么?如果我做这样的事情:
List extends Map> currentList = new ArrayList>();
Collection> addAll = new ArrayList>();
// add some hashmaps to the list..
currentList.addAll(addAll);
我知道我需要初始化这两个变量.但是,我得到一个编译错误(来自eclipse):
Multiple markers at this line
- The method addAll(Collection extends capture#1-of ? extends Map>) in the type List> is not applicable for the arguments (List
Map>)
- The method addAll(Collection extends capture#1-of ? extends Map> is not applicable for the arguments
(Collection>)
我究竟做错了什么?