LongStream concat(LongStream a, LongStream b)
concatenates streams.
concat
has the following syntax.
static LongStream concat(LongStream a, LongStream b)
The following example shows how to use concat
.
import java.util.stream.LongStream; public class Main { public static void main(String[] args) { LongStream b = LongStream.concat(LongStream.rangeClosed(1L, 5L),LongStream.rangeClosed(1L, 6L)); b.forEach(System.out::println); } }
The code above generates the following result.