This is due to the behavior of Java generics:
Even if Athey Bare compatible types, SomeType<A>not compatible withSomeType<B>
A classic example of this is the purpose of List<Cat>a List<Animal>.
The same thing happens here. You List<T>can usually assign List<?>. But since you are appointing List<List<T>>to List<List<?>>, you cannot.
source
share