Java Lambda Expressions #3 - Variable Capture

preview_player
Показать описание
Java Lambda Expressions cannot have their own state, like other classes can. The only way a Java lambda expression can have any kind of internal state is by referencing a variable declared outside the lamdba expression. This video explains how that is done, and the rules for doing so.

This video is part of a playlist on Java lambda expressions which you can see here:

I also have a text version of the Java lambda expression playlist here:

Рекомендации по теме
Комментарии
Автор

The fact that you created a website where you make tutorials and also created videos here on youtube to make more clear some topics that are scary for newcomers shows how dedicated and how awesome guy you are and i can't be thankfull enough for this! I learn java for more than a year, i finished a bootcamp and fight with the code daily 2-3 hours to become a developer and soon i want to start interviews, so i started to repeat and exercise for them. Im more like a visual type and when things got super complicated in tutorials that are wrote, im starting to search for another more simpler to get the ideas, and when i saw that you made videos too for them, it was a relief. You saved me a lot of time. All these videos were crystal clear. Thanks for all your work, looking up to see more videos!

hegyilevente
Автор

When he says "IntelliJ got a little to intelligent there" I laughed :) 6:36

jameswait
Автор

Thank you Jakob for these great tutorials! Wish there were more videos about lambdas! i strongly feel that i have learned things of value and did it in a quite efficient way! Wish u all the best!

utkuceylan
Автор

Quite a good explanation of lambda expression in java.

rajnishpsinha
Автор

Thanks for these tutorials. You explained it very well.

jakobball
Автор

great tutorial, but I am struggling to se how lambda would be efficient to use for logic behind a program. Is it possible that in the future you will release a video where you implement it in a program? for example a calculator or something similar?

Norsketrutt
Автор

Nice examples and Very wonderful tutorial on lambda expression. Hoping to bag walmart labs offer with this knowledge.

dragonceo
Автор

Why is it a problem with a local variable that it needs to be final. Is there a logical answer why it would create a problem with implemented method if it changes?

ameyjain
Автор

Please excuse my stupid questions. But, why did you not have to reference the instance variable while using it in the doIt() method as this.fourthText?? Is this implied?? I am very confused

YugShende
Автор

Thanks for your tutorial, this useful....

muammaryusuf
Автор

Nice Video, Next go towards "method references"

adeelahmad
Автор

I love this lesson. (Are you American?)

nvs
Автор

nice Video! hope you public more video

lapnghiepshopee
Автор

Nice video, indeed.. but where is your voice, dude ?

evgenistanchev