DoubleStream count() example
Description
DoubleStream count()
returns the count of elements in this stream.
Syntax
count
has the following syntax.
long count()
Example
The following example shows how to use count
.
import java.util.stream.DoubleStream;
/*from w ww .ja v a2 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.