Files
java-core-examples/streams/output/06-primitivestreams.txt
T

12 lines
509 B
Plaintext

rangeClosed(1,100).sum() : 5050
summaryStatistics : IntSummaryStatistics{count=8, sum=31, min=1, average=3.875000, max=9}
mapToInt(length).sum() : 17
average of empty IntStream : OptionalDouble.empty
sum of empty IntStream : 0
boxed().toList() : [1, 2, 3]
IntStream sum overflow : -2147483648
asLongStream sum : 2147483648
Math.addExact in long : no overflow
Math.addExact in int : integer overflow
Stream<Integer>.reduce sum : -2147483648 <- also wraps