DoubleStream summaryStatistics() example

Description

DoubleStream summaryStatistics() returns a DoubleSummaryStatistics describing various summary data about the elements of this stream.

Syntax

summaryStatistics has the following syntax.


DoubleSummaryStatistics summaryStatistics()

Example

The following example shows how to use summaryStatistics.


import java.util.DoubleSummaryStatistics;
import java.util.stream.DoubleStream;
//from w w w.j av  a 2 s .  c o m
public class Main {
  public static void main(String[] args) {
    DoubleStream b = DoubleStream.of(1.1,2.2,3.3,4.4,5.5);
    DoubleSummaryStatistics d = b.summaryStatistics();
    System.out.println(d);
    
  }
}

The code above generates the following result.





















Home »
  Java Streams »
    Reference »




Collectors
DoubleStream
DoubleStream.Builder
IntStream
IntStream.Builder
LongStream
LongStream.Builder
Stream
Stream.Builder