I have just implemented some classes:
public abstract class Job<T extends ViewerUnion>{
[...]
}
public abstract class ReturnValueJob<T, S extends ViewerUnion> extends Job<S> {
[...]
}
public class MyReturnJob extends ReturnValueJob<Foo, Baa> {
[...]
}
public class JobExecuter {
public static void execute(List<Job> jobList){
for(Job actJob: jobList){
actJob.startJob();
}
for(Job actJob: jobList){
actJob.awaitTimeoutOrFinish();
}
}
}
Now I want to execute this code:
List<Job> list = new LinkedList<MyReturnJob>();
JobExecuter.execute(list);
But Java gives me some error while compiling:
Type mismatch: cannot convert from LinkedList to List
I don't know why because the MyReturnJob is inheriting the Job.
If I change the definition of the list to LinkedList<MyReturnJob> list = new LinkedList<MyReturnJob>();
The same error is thrown on JobExecuter.execute(list);
Thanks for your help.
Best regards, Till