DoubleStream builder()
returns a builder for a DoubleStream.
builder
has the following syntax.
static DoubleStream.Builder builder()
The following example shows how to use builder
.
import java.util.stream.DoubleStream; /*ww w .j a v a2 s.com*/ public class Main { public static void main(String[] args) { DoubleStream.Builder b = DoubleStream.builder(); b.accept(1.2); b.accept(1.2); b.accept(1.2); DoubleStream d = b.build(); d.forEach(System.out::println); } }
The code above generates the following result.