List<List<?>> and List<List> are incompatible types in java [duplicate]
问题 This question already has answers here : Cannot convert from List<List> to List<List<?>> (3 answers) Closed 4 years ago . I did not get this code to compile either way: List<List> a = new ArrayList(); List<List<?>> b = new ArrayList(); a = b; // incompatible types b = a; // incompatible types It seems that java does not consider List and List<?> to be the same type when it comes to generics. Why is that? And is there some nice way out? Context There is a library function with following