public abstract class AbstractTool<AT extends AbstractThing> {
protected ArrayList<AT> ledger;
public AbstractTool() {
ledger = new ArrayList<AT>();
}
public AT getToolAt(int i) {
return ledger.get(i);
}
// More code Which operates on Ledger ...
}
public class Tool<AT extends AbstractThing> extends AbstractTool {
public Tool() {
super();
}
}
How do I correctly call super to pass the AT
generic of Tool
to the AbstractTool constructor?
It seems no matter what I pick AT
to be when I declare Tool
(Say, Tool<Thing>
), that I always get back an AbstractThing
instead of Thing
. This seems to defeat the purpose of generics...
Help?