Reputation: 12510
I need to derive from the following class:
public abstract class MyTool<VIEW extends MyView>
implements LookupListener, MouseListener, MouseMotionListener, KeyListener {}
The following does not work:
public abstract class MySubTool<VIEW> extends MyTool<VIEW> {}
Thanks !
Upvotes: 3
Views: 479
Reputation: 89209
This should:
public abstract class MySubTool<VIEW extends MyView> extends MyTool<VIEW> {}
Upvotes: 1
Reputation: 20895
The compiler in MySubTool as no way of knowing that VIEW
in MySubTool
is a subclass of MyView
, you have to specify it again:
public abstract class MySubTool<VIEW extends MyView> extends MyTool<VIEW> {}
Upvotes: 3