Duplicate :
|
|
Relates :
|
|
Relates :
|
Let's consider following code: public class Test49 { interface Iface<T extends Number> { void m(T...t); } public static void main(String argv[]) { Iface<? super Integer> i = (Integer...a) -> System.out.println("lmbd"); i.m(1, 2, 3); } } this code causes following error at runtime: Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Number; cannot be cast to [Ljava.lang.Integer; at Test49$$Lambda$1/1421795058.m(Unknown Source) at Test49.main(Test49.java:9) JDK-8049075 previously caused compiler error in similar case.
|