DoubleStream count()
returns the count of elements in this stream.
count
has the following syntax.
long count()
The following example shows how to use count
.
import java.util.stream.DoubleStream; // w w w. ja v a 2 s. c o m public class Main { public static void main(String[] args) { DoubleStream d = DoubleStream.of(1.2,4.5,1.2,2.3); long r = d.count(); System.out.println(r); } }
The code above generates the following result.