I\'ve been beating my head against this one for awhile and thought that maybe some fresh eyes will see the issue; thanks for your time.
import java.util.*;
clas
you cannot add any objects to TbinList extends Base>
,it is not guaranteed what objects you are inserting into the list. It is supposed to read data from test2
when you use wildcard extends
If you declared as TbinList extends Base>
which means you it is any subclass of the class Base or class Base itself, and when you initialize it you use diamond other than concrete class name, it makes your test2
not obvious which makes it harder to tell what objects can be inserted. My suggestion is that avoid such declaration it is dangerous, it may not have compile errors but it is horrible code, you might add something, but you also might add the WRONG thing which will break your code.