I have a Java question about generics. I declared a generic list:
List extends MyType> listOfMyType;
Then in some method I try ins
There is a similar thread here: How can elements be added to a wildcard generic collection?
To get an idea of how generics works check out this example:
List sfoo = new ArrayList();
List foo;
List extends Foo> tmp;
tmp = sfoo;
foo = (List) tmp;
The thing is, that wasn't designed for local/member variables, but for function signatures, that's why it's so ass-backwards.