List<List>
implicitly
List<List<Object>>
which is not a parent
List<List<String>>
the reason he succeeds in the first case is type inference. The compiler essentially checks what type is needed so that the expression makes sense, and it will generate
List<List<String>> a = b;
In the second case, the default will be
List<List<Object>> a = b
source share