2010-04-23 19:59:45
1
What is the correct type of argument to the addAll(..) method in Java collections? If I do something like this:
List extends Map> currentList = new ArrayList>();
Collection> addAll = new ArrayList>();
// add some hashmaps to the list..
currentList.addAll(addAll);
I understand I need to initialize both variables. However, I get a compilation error (from 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>) in the type List> is not applicable for the arguments
(Collection>)
what am I doing wrong?