2 ms·
It's really flatMap/map from the link: List<Integer> s1 = Stream.of(1, 2); Supplier<Stream<String>> s2 = ()->Stream.of("A", "B"); s1.flatMap(v1 -> s2.ge
by karmakaze 7y ago
It's really flatMap/map from the link:
List<Integer> s1 = Stream.of(1, 2);
Supplier<Stream<String>> s2 = ()->Stream.of("A", "B");
s1.flatMap(v1 -> s2.get()
.map(v2 -> tuple(v1, v2)))
.forEach(System.out::println);
That's just a nested loop.