Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Java 8 merge multiple collections using flatmap

Stream<String> combinedStream = Stream.of(collectionA, collectionB)
  .flatMap(Collection::stream);
Collection<String> collectionCombined = 
  combinedStream.collect(Collectors.toList());
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #Java #merge #multiple #collections #flatmap
ADD COMMENT
Topic
Name
7+7 =