DoubleStream of(double t)
creates a sequential DoubleStream containing a single element.
of
has the following syntax.
static DoubleStream of(double t)
The following example shows how to use of
.
import java.util.stream.DoubleStream; /*from w ww . ja v a 2 s . c o m*/ public class Main { public static void main(String[] args) { DoubleStream d = DoubleStream.of(1.2); d.forEach(System.out::println); } }
The code above generates the following result.