This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: Java 8 Stream flatMap
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
In this post, we will see about Java 8 Stream flatMap function.Before understanding flatMap, you should go through stream’s map function Stream’s flatMap method takes single element from input stream and produces any number of output values and flattens result to output stream.When you apply flatMap function on each of element of the stream, it results in stream of values rather than single value as in case of Stream’s map function. Java 8 Stream flatMap function As per java docs, Stream’s flatMap returns a stream consisting of the results of replacing each element of this stream with the contents of a