J'ai créé un TreeMap comme ceci:hiérarchie d'objets java, et les objets qui passent à des fonctions
TreeMap<Integer, ArrayList<MyClass>> wrap = new TreeMap<Integer, ArrayList<MyClass>>();
J'ai créé un constructeur comme ceci:
public foo (TreeMap<Integer, Collection<Spot> > objects) {
this.field = objects;
}
Cependant, éclipse me donne un Squigly rouge quand j'utilise le constructeur, avec ma variable wrap
comme paramètre unique:
The constructor foo(TreeMap<Integer,ArrayList<Spot>>) is undefined
un ArrayList est une ty pe de Collection ... oui? Alors pourquoi ça ne marche pas?