Why summaryStatistics() method on an empty IntStream returns max and min value of integer as the maximum and minimum int value present in the stream?
IntStream intStream = IntStream.of();IntSummaryStatistics stat = intStream.summaryStatistics();System.out.println(stat);
Output:
IntSummaryStatistics{count=0, sum=0, min=2147483647, average=0.000000, max=-2147483648}
- What is the point of returning these values?
- Should not it considered the wrong result?