IntStream summaryStatistics()
returns an IntSummaryStatistics describing various summary data about the elements of this stream.
summaryStatistics
has the following syntax.
IntSummaryStatistics summaryStatistics()
The following example shows how to use summaryStatistics
.
import java.util.IntSummaryStatistics; import java.util.stream.IntStream; /* w w w .j a v a 2s . c o m*/ public class Main { public static void main(String[] args) { IntStream i = IntStream.of(6,5,7,1, 2, 3, 3); IntSummaryStatistics s = i.summaryStatistics(); System.out.println(s); } }
The code above generates the following result.