tag:blogger.com,1999:blog-694855878384792308.post4908793261382572839..comments2024-03-21T06:26:49.387-07:00Comments on Java67: Java 8 Stream + FlatMap Example for Beginners | How to flat a list of list in Java?javin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-694855878384792308.post-81114004005932554472023-07-10T06:57:52.336-07:002023-07-10T06:57:52.336-07:00pList.stream() it's not workingpList.stream() it's not workingAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-55003051147783631672019-09-08T07:51:52.118-07:002019-09-08T07:51:52.118-07:00instead of using lambda expression .flatMap(pList ...instead of using lambda expression .flatMap(pList -> pList.stream()) we can use .flatMap(Collection::stream) ,looks neatAnonymoushttps://www.blogger.com/profile/15432190135023807882noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-78507055411367682692019-03-20T20:38:27.940-07:002019-03-20T20:38:27.940-07:00Very nice explaination before this I was in confus...Very nice explaination before this I was in confusion modeMadhavhttps://www.blogger.com/profile/09145840963501433540noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-1279941529672191712017-06-27T06:51:24.737-07:002017-06-27T06:51:24.737-07:00@Anonymous, yes, good spot though. @Anonymous, yes, good spot though. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-694855878384792308.post-74744302456682473592017-06-26T12:43:41.433-07:002017-06-26T12:43:41.433-07:00> The result would be [[3,7],[23],[2,3,7]]. If ...> The result would be [[3,7],[23],[2,3,7]]. If you want to flat this stream of a stream into a stream of values,<br />> you can use the flatMap() which will return [3,7,2,3,2,3,7].<br /><br />In your list, should the 2,3 be 23, meaning the list is [3,7,23,2,3,7]Anonymousnoreply@blogger.com