Creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the
elements of the second stream. The resulting stream is ordered if both of the input streams are ordered, and
parallel if either of the input streams is parallel. When the resulting stream is closed, the close handlers for
both input streams are invoked.
package com.logicbig.example.doublestream;
import java.util.Arrays;
import java.util.stream.DoubleStream;
public class ConcatExample {
public static void main(String... args) {
DoubleStream ds1 = DoubleStream.of(1.2, 1.3, 1.4);
DoubleStream ds2 = DoubleStream.of(1.5, 1.6, 1.7);
DoubleStream ds = DoubleStream.concat(ds1, ds2);
System.out.println(Arrays.toString(ds.toArray()));
}
}
Output
[1.2, 1.3, 1.4, 1.5, 1.6, 1.7]