I have an created an Interface HTMLlizeable
and implemented this Interface in currently two classes (Course implements HTMLlizeable
and Student implements HTMLlizeable
)
The loadAll
Method looks like this :
public ArrayList<Course> loadAll(){...}
Now if i try to compile this line
ArrayList<HTMLlizeable>courses=this.db.getCourseLoader().loadAll();
javac or eclipse in my case always gives me this error ...
Cannot cast from ArrayList<Course> to ArrayList<HTMLlizeable>
.. and i have no idea why because Course implements HTMLlizeable. What am I doing wrong - or is this a limitation of the Generics in Java. The same thing happens btw with Student too.