DoubleStream concat(DoubleStream a, DoubleStream b) example

Description

DoubleStream concat(DoubleStream a, DoubleStream b) concatenates streams.

Syntax

concat has the following syntax.


static DoubleStream concat(DoubleStream a,   DoubleStream b)

Example

The following example shows how to use concat.


import java.util.stream.DoubleStream;
import java.util.stream.Stream;
//from ww w . ja va  2  s.  c o m
public class Main {
  public static void main(String[] args) {
    DoubleStream i = DoubleStream.concat(DoubleStream.of(1.0,2.0,3.3),DoubleStream.of(4.4,5.5,6.6,7.7));
    Stream<Double> o =  i.boxed();
    
    o.forEach(System.out::println);
  }
}

The code above generates the following result.





















Home »
  Java Streams »
    Reference »




Collectors
DoubleStream
DoubleStream.Builder
IntStream
IntStream.Builder
LongStream
LongStream.Builder
Stream
Stream.Builder