mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-20 22:17:09 +08:00
commit
955c82756d
@ -627,7 +627,7 @@ public class MapAndFlatMapExample {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
System.out.println("Using map:");
|
System.out.println("Using map:");
|
||||||
System.out.println(mapResult);
|
mapResult.forEach(arrays-> System.out.println(Arrays.toString(arrays)));
|
||||||
|
|
||||||
List<String> flatMapResult = listOfArrays.stream()
|
List<String> flatMapResult = listOfArrays.stream()
|
||||||
.flatMap(array -> Arrays.stream(array).map(String::toUpperCase))
|
.flatMap(array -> Arrays.stream(array).map(String::toUpperCase))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user