Bounded Wildcards in Java
-
07-12-2019 - |
문제
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;
제휴하지 않습니다 StackOverflow