문제

This is not fine

     List<List<? extends Number>> a;
     List<List<Integer>> b;
     a = b;

This is fine

     List<? extends Number> c;
     List<Integer> d;
     c = d;

How can make it compile first one?

도움이 되었습니까?

해결책

You could use this:

List<? extends List<? extends Number>> a;
List<List<Integer>> b;
a = b;

다른 팁

List<? extends List<? extends Number>> a = null;
List<List<Integer>> b = null;
a = b;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top