0 votes
in JAVA by
What does the flatmap() function do? why you need it?

1 Answer

0 votes
by
The flatmap function is an extension of the map function. Apart from transforming one object into another, it can also flatten it.

For example, if you have a list of the list but you want to combine all elements of lists into just one list. In this case, you can use flatMap() for flattening. At the same time, you can also transform an object like you do use map() function.

Related questions

+1 vote
asked Apr 15, 2021 in JAVA by SakshiSharma
0 votes
asked Jan 24, 2020 in JAVA by rahuljain1
...