Java generic class and wildcards
问题 I've got a problem with generic classes in java. I've got this class: public abstract class MyMotherClass<C extends AbstractItem> { private C item; public void setItem(C item) { this.item = item; } public C getItem() { return item; } } An implementation of this class can be: public class MyChildClass extends MyMotherClass<ConcreteItem> { } ConcreteItem is just a simple class that extends AbstractItem (which is abstract). so MyChildClass have a ConcreteItem and I can use: MyChildClass child =