lundi 29 juin 2015

won't accept A's child classes


I'm working with Android Studio and I keep getting a problem I don't know how to solve. I don't know whether it's a problem with Android Studio, with Java or a mistake a make.

I have a class whose constructor is the following:

public MakeQuery(Callable<ArrayList<? extends A>) {
     ...
}

I try to create an object of that class with the following lines:

Callable<ArrayList<B>> callable = new Callable<ArrayList<B>>() {...};
MakeQuery makeQuery = new MakeQuery(callable);

(Of course, class B extends A. Double checked)

But when I call the constructor the IDE tells me that it expects another type of argument.

What mistake am I making? Thanks for all the help! :)


Aucun commentaire:

Enregistrer un commentaire