Java 8 Streams Java Java API
Interface:
java.util.stream.DoubleStream
Methods:
static DoubleStream of(double t)
This method returns a sequential DoubleStream containing the single specified element.
static DoubleStream of(double... values)
This method returns a sequential ordered DoubleStream whose elements are the specified values.
Examples
package com.logicbig.example.doublestream;
import java.util.stream.DoubleStream;
public class OfExample {
public static void main(String... args) { DoubleStream ds = DoubleStream.of(1.0, 1.2, 2.0, 2.4, 3.0); ds.forEach(System.out::println); } }
Output1.0 1.2 2.0 2.4 3.0
|