I believe that you just want
private ArrayList<WorkTabPane> workTabPanes = null; protected void addPane(WorkTabPane pane) { workTabPanes.add(pane); }
(You can add subclasses of WorkTabPane to the list.)
The reason eclipse complains is this: by writing <? extends WorkTabPane> <? extends WorkTabPane> , you say: "This is a list of some specific class that extends to WorkTabPane." This variable may contain, for example, a reference to ArrayList<WorkTabPaneSubclass1> . However, if this happens, you should not be allowed to add items like WorkTabPaneSubclass2 to the list. Do you see the problem?
source share