DoubleStream.Builder add(double t)
adds an element to the stream being built.
add
has the following syntax.
default DoubleStream.Builder add(double t)
The following example shows how to use add
.
import java.util.stream.DoubleStream; /*from w ww. jav a 2 s . c o m*/ public class Main { public static void main(String[] args) { DoubleStream.Builder b = DoubleStream.builder(); b.add(1.1) .add(2.2) .add(3.3) .add(4.4); b.build().forEach(System.out::println); } }
The code above generates the following result.