incompatible types: inference variable T has incompatible bounds [duplicate]

Arrays.asList is expecting a variable number of Object. int is not an Object, but int[] is, thus Arrays.asList(A) will create a List<int[]> with just one element.

You can use IntStream.of(A).boxed().collect(Collectors.toList());

Leave a Comment