I have the following piece of code
public int solution(int X, int[] A) {
List<Integer> list = Arrays.asList(A);
For some reason it's throwing the following compilation error
Solution.java:11: error: incompatible types: inference variable T has incompatible bounds List list = Arrays.asList(A); ^ equality constraints: Integer lower bounds: int[] where T is a type-variable: T extends Object declared in method asList(T...)
I assume this a Java 8 feature, but I'm not sure how to resolve the error
Integer[]
instead ofint[]
.