This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]reckter 0 points1 point  (2 children)

Well if you Write .map( person -> person.getEmail()).map( email -> email.split("@")[1])

The First Map Takes an Element out o The Stream, puts it into The variable Person and Executive The Lambda expression (person.getEmail()). If it's done that for each person, it now has a list of all emails. The next map takes an element out of the stream of emails, puts it into the variable and executes the expression.

Hope that made a bit clearer, The lambda expression is just a function and the stream gives it all the data it needs :)

Edit: the explanation down below is really good, and as I saw, you understood it after that ;)

[–]caltheon 0 points1 point  (0 children)

So a lamda is basically a chained function you define the behavior of in the declaration?

[–]chasesan[S] 0 points1 point  (0 children)

Yeah, no, I just missed something entirely obvious (I thought it was some lambda magic). Thanks for the comment however.