1
0
mirror of https://github.com/apachecn/modern-java-zh.git synced 2025-06-06 17:50:56 +00:00
This commit is contained in:
LaJiZhongZhuanZhan 2016-12-03 12:20:34 +08:00 committed by GitHub
parent 29dacf960e
commit 7ccda3924b

2
ch2.md
View File

@ -543,7 +543,7 @@ foos.stream()
IntStream.range(1, 4)
.mapToObj(i -> new Foo("Foo" + i))
.peek(f -> IntStream.range(1, 4)
.mapToObj(i -> new Bar("Bar" + i + " <- " f.name))
.mapToObj(i -> new Bar("Bar" + i + " <- " + f.name))
.forEach(f.bars::add))
.flatMap(f -> f.bars.stream())
.forEach(b -> System.out.println(b.name));