You cannot do a “put” with extends . Look at Generics – Get and Put rule.
More Related Contents:
- What is PECS (Producer Extends Consumer Super)?
- How do you cast a List of supertypes to a List of subtypes?
- Java Generics (Wildcards)
- Java Generics With a Class & an Interface – Together
- Why can’t you have multiple interfaces in a bounded wildcard generic?
- Creating new generic object with wildcard
- Java nested generic type
- What is the difference between bounded wildcard and type parameters?
- How to have Java method return generic list of any type?
- Bounded-wildcard related compiler error
- Java: Casting from List to List when B implements A?
- Create a List of primitive int?
- What does List mean in java generics?
- new ArrayList() failing in Java
- Java generic methods: super can’t be used?
- Java: bounded wildcards or bounded type parameter?
- Unbounded wildcards in Java
- What’s the difference between unbounded wildcard type List and raw type List?
- Remove duplicates from a list of objects based on property in Java 8 [duplicate]
- Java 8 stream reverse order
- Why does javac complain about generics unrelated to the class’ type arguments? [duplicate]
- How can I return the difference between two lists?
- Android: How to disable list items on list creation
- How to Autowire Bean of generic type in Spring?
- Sort List in reverse in order
- What is a List vs. an ArrayList? [duplicate]
- Why do some claim that Java’s implementation of generics is bad?
- Initialize Java Generic Array of Type Generic
- Heterogeneous container to store genericly typed objects in Java
- Converting an int array to a String array