Skip to content

AssouaAlbert/java8-map-vs-flatMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java8

Java 8 features

Differences between Java 8 Map() Vs flatMap() :

map() flatMap()
It processes stream of values. It processes stream of stream of values.
It does only mapping. It performs mapping as well as flattening.
It’s mapper function produces single value for each input value. It’s mapper function produces multiple values for each input value.
It is a One-To-One mapping. It is a One-To-Many mapping.
Data Transformation : From Stream to Stream Data Transformation : From Stream<Stream to Stream
Use this method when the mapper function is producing a single value for each input value. Use this method when the mapper function is producing multiple values for each input value.

About

Java 8 features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%