0 votes
in JAVA by
What is difference between flatMap() and map() functions?

1 Answer

0 votes
by

Even though both map() and flatMap() can be used to transform one object to another by applying a method on each element.

The main difference is that flatMap() can also flatten the Stream. For example, if you have a list of the list, then you can convert it to a big list by using flatMap() function.

Related questions

0 votes
asked Feb 16, 2023 in Spark Preliminaries by Robindeniel
+1 vote
asked Apr 15, 2021 in JAVA by SakshiSharma
...