I have a code:
int[] values = { 1, 4, 9, 16 };
Stream<Integer> ints = Stream.of(values);
which gives me a compilation error. But:
int[] values = { 1, 4, 9, 16 };
Stream<Integer> ints = Stream.of(new Integer[] {1, 4, 9, 16});
does not give so. Why?
source
share