DoubleStream of(double... values)
creates a sequential ordered stream whose elements are the specified values.
of
has the following syntax.
static DoubleStream of(double... values)
The following example shows how to use of
.
import java.util.stream.DoubleStream; /*ww w . ja va 2 s . co m*/ public class Main { public static void main(String[] args) { DoubleStream d = DoubleStream.of(1.2,2.3,4.5); d.forEach(System.out::println); } }
The code above generates the following result.