M
M
mitaichik2017-03-27 02:25:36
Java
mitaichik, 2017-03-27 02:25:36

How to multiply 2 streams (Stream API)?

There are 2 streams:

Stream<String> stream1 = Arrays.stream(new String[]{"1", "2"});
Stream<String> stream2 = Arrays.stream(new String[]{"a", "b"});

You need to get a stream with the following data: 1a, 1b, 2a, 2b
How to do this? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Janus74, 2017-03-27
@mitaichik

StringBuilder or StringBuffer and loop

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question