Nested Generics with Wildcards
generics, java
Solution
Try
List<? extends List<?>> list = new LinkedList<List<Integer>>();
Note: you should be aware that when you use a collection like List you will only be able to use it in "read only" mode (except for adding null values).
Problem
Why does this work: ``` List<?> list = new LinkedList<Integer>(); ``` while this gives a type dismatch error: ``` List<List<?>> list = new LinkedList<List<Integer>>(); ``` Why is this? Ist there a way around this, without using raw types?