I\'m trying to make a List from a primitive array
int[] values={4,5,2,3,42,60,20}; List greaterThan4 = Arrays.stream(values) .filter(v
Yes this is because Arrays.stream returns an IntStream. You can call boxed() to get a Stream and then perform the collect operation.
Arrays.stream
IntStream
boxed()
Stream
List greaterThan4 = Arrays.stream(values) .filter(value -> value > 4) .boxed() .collect(Collectors.toList());