Quantcast
Channel: summaryStatistics Method of IntSummaryStatistics - Stack Overflow
Viewing all articles
Browse latest Browse all 5

summaryStatistics Method of IntSummaryStatistics

$
0
0

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}
  1. What is the point of returning these values?
  2. Should not it considered the wrong result?

Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images