One additional note - although lambdas do only work in the context of a functional interface, you don't necessarily need to always create your own in order to use one. There are many that are built into Java, and they cover most uses cases you'll see: docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html
@rokitap.w11933 жыл бұрын
I swear John you must be going to my university with me or something this is the exact thing I needed thank you!
@libertymedicalcommunicatio49083 жыл бұрын
Thanks for this
@Hufsa3 жыл бұрын
Great, I was looking for this, thank you!
@yasseromari10743 жыл бұрын
Good job , thank you for that !! Also I would love to see you making a video about streams and how we can associate the use of it with lambdas. Regards 👍🏻
@babythedude3 жыл бұрын
Please do Java Reflection, if there is a person who can do it well, it would be you
@djk12882 жыл бұрын
My biggest "a-ha" moment here was when you showed how we go from public void print() {} to just () -> {}. Super intuitive, very good work!
@victormmm2085Күн бұрын
the only person who doesn't overcomplicate programming
@felipe26373 жыл бұрын
I am always impressed by how good you are at making yourself understandable, your explanations are all clear and meaningful. It's definitely a privilege being able to access such a high quality content for free.
@gatescob Жыл бұрын
Yes
@ntigirishari Жыл бұрын
Oh yeah!!!😀
@danielcommins12853 жыл бұрын
The key point here like you say is lambdas allow method definitions to be used as variables/objects. Many other languages allow for function names to be passed as variables for callbacks and whatnot and Java never had a clean way to do that until lambdas. Only thing I would add to this is that putting the parameter type in the lambda expression is allowed and makes it easier to understand that the lambda is a method definition: (String p, String s) -> //code
@stepbystepcoding41132 жыл бұрын
thanks, bc i was wondering what was the point of all this, it didn't look like a step forward at first, it looked like a step backwards
@enfieldli92962 жыл бұрын
It works like JS callback/anonymous function. The method definition: (String p, String s) -> {}; is indeed a caveat
@christianbarnay249911 ай бұрын
Reflection allows that. And it exists since the very first versions of Java. It even does more than that. It allows you to break scope limitations and call a private/protected/package method from places that are not supposed to see the method. I used reflection once in my entire career. It was in java 1.2. And it was to access a method in a library that was erroneously declared as private by its author. At that time I didn't have access to a decompiler. Of course when I have a similar situation now, I simply decompile the class to create an override in my source code.
@feynthefallen11 ай бұрын
I wouldn't call that a clean way of doing it. You have to essentially create a type (functional interface) to which you then can dynamically assign an ad hoc implementation. In my mind, that's just a stupid way of doing it, compared to C or Javascript. What I would have done would be to introduce a parametrized type Function, that lets you create the declaration on the fly, like so: Function fancySquare = (String s, Number n) -> s + (n*n)
@danielcommins128510 ай бұрын
@@feynthefallencan't you just create that parameterized type yourself? The current implementation gives more flexibility.
@ziqimage2 жыл бұрын
The quality of this channel, no word.
@carlellis96472 жыл бұрын
I've been doing Java based web application development for over 20 years. I often like to take refresher courses on things I've studied before. This is easily the best explanation with practical examples I've seen for Java Lambas. The concepts are clearly explained. Thanks John for making such a great video!
@zipkitty Жыл бұрын
You did in 5 minutes what my Uni prof. couldn't in two lectures. That goes to show how much people who actually use java professionally have a deeper understanding of java.
@andersonabe50443 жыл бұрын
Hi, John, I'm not a quick learner, but I work hard. English is not my native language, and I watch and rewatch your videos a couple of times - and I can say: if you keep doing this amazing videos, I might learn some java. I'm reading a java handbook right now, but next, I'll take your course.
@fabiorachid34302 жыл бұрын
Head First Java book can be really helpful to you, it's really clear and easy to understand. It has translations to many languages too. You probably can find a PDF online. Use it as a complement to John's videos. Good luck!
@emmanuelnsiah8036 Жыл бұрын
You should start right now too
@xsraut3 жыл бұрын
Please don't ever stop uploading. These videos help me in my academics and coding in general a lot. Thank You.
@raymondorenda73852 жыл бұрын
Ever seen someone watching a tutorial even if he already knows the concept? well, that guy wasting time is me. I love the way he explains things. Keep it up, man.
@stephanieezat-panah775011 ай бұрын
lol. me too!
@robertzaryal34162 жыл бұрын
I found Lambda Expression is the exact same Arrow Function in JavaScript. I think it's usable in terms of functional programming but don't know whether there is a need of it in object oriented language like Java! Thumbs up for you, indeed you are a great teacher.
@jonathanchiii17062 жыл бұрын
Lambda is a shortcut to define an implementation of a functional interface. Instead of creating a class that implements that functional interface and adding an implementation that you want of that single abstract method, and create an object of this class, you simply create a lambda expression that contains the implementation of that functional interface method that you want. Man this summary clears out all my confusion about the significance of functional interface and lambda expression. Thank you soooo much for the clarification!!!
@EricKolotyluk2 жыл бұрын
I have been using lambdas for many years, first with Scala, then with Java, and watching your video, I am amazed how much I learned. Kudos to you for creating such as useful lesson...
@dangnguyen.923 жыл бұрын
I have never seen anyone who can explain lambas expression as good as your. You help a lot for ppl who doesnt lambas.
@hmzza12 жыл бұрын
With more than 20 years experience in Java programming, you really explain advanced topics so simple!!
@prathap2712 Жыл бұрын
I had to watch dozens of videos to understand lambda expressions. Finally i found the right one. Thanks a ton 🙏
@MaryamMaqdisi3 жыл бұрын
I've been using lambda for a while but it's the first time I understand how it works behind the scenes, thanks a lot for this video!
@raz02293 жыл бұрын
Java receives a lot of backlash from inexperienced and experienced developers of being too old school, bloated and lacking modern features and syntax, although.. ever since I have started watching your videos, I've seen a major improvement and they are really trying to keep things up to date as of lambda expressions which provide more of a functional approach towards problems. Turns out you just need a teacher like John to really appreciate and understand it. :)
@Quinteger3 жыл бұрын
Also this feature has existed for a long time, version 8 where it was introduced came out in 2014. Since then they greatly accelerated their version bump speed, currently we are at version 17 with a lot of new features like local type-inferred vars, switch lambdas, data records and so on.
@AmanRaj-dh2ru8 ай бұрын
one of the best, succinct yet comprehensive overviews of lambdas in java that i've ever come across! thanks a lot
@cavendar24 Жыл бұрын
I appreciate how your videos get straight to the point. I tried watching a video from another channel about a Java topic and at least half of the video could have been edited out with no loss of meaningful information.
@twisterwiper2 жыл бұрын
Wow. This is the best explanation of lambdas I have come across. How you trim the expression in the beginning, removing access modifiers and so on is really great. Thank you!
@burgerbob73242 жыл бұрын
That was extremely helpful in understanding what the heck is going on with the lambda syntax. I've seen them before but immediately understand it better after seeing him do that.
@alexj15803 жыл бұрын
When I first started coding, I have used Java and these videos have been a great refresher on the smaller and intricate things that Java has to offer. Great videos! Already learned so many things.
@1234567mrbob3 жыл бұрын
This was a big help! I've been programming in Java for 5 years, but used it like a traditional language and didn't use lambdas. They were always a big mystery to me. When I took a Java skill test there were a lot of lambda questions so that hurt me. This short course explained a lot.
@ShubhamSingh-vh1vw Жыл бұрын
This was by far the best explanation for lambda. PERIOD
@afrasm24782 жыл бұрын
Took this 13 minute video over my 2 hour lecture and i can proudly say i understand it better and didnt ever fell asleep in btw
@ivankobyuk83853 жыл бұрын
Huge THANK YOU from Ukrainian developer! / Велике дякую Вам від українського розробника!
@juanestebanparraparra85317 ай бұрын
I must say you are one of the greatest coding teachers I have ever seen! Thanks John!
@clarence9527 Жыл бұрын
I am a python engineer, not very proficient in java, but thanks to your course. Maybe sometimes your courses are simple, but they are still very helpful to me.
@phonesj34222 жыл бұрын
OMG You are really really really a good teacher!!! I had got stuck of understanding the concept of Lambda for days till watching this video! Thanks a lot!!!
@dreamtreater Жыл бұрын
I have been working through a Java Udemy course, but it wasn't able to explain this subject to me. Watching your video is a relief! Now I understand! It's so much better.
@assur74776 ай бұрын
You are doing by far the best Explanations for Java and figuring out how to use all the Tools the Language gives you. Currently, struggling mighty with my Coding Exam in a couple of days, but you are saving my ass, so a Huge Thank You!
@simongraham25162 жыл бұрын
Never came across a more clearer explanation!
@houdaejbkl5126 Жыл бұрын
John ! I want you to know that you're the coolest Java teacher. I injoyed your courses a lot , so THANK YOU !!
@nikosaspridis8091 Жыл бұрын
I am studying cs in university and we had an oop course in java this semester... Thank you very much ! :)
@GuilhermePalazzoRodrigues2 жыл бұрын
This course is a gem, concise, clear and thorough, thank you!
@HeyThereGuy2 жыл бұрын
Listen bro, this is the best explanation of Lambda's I've seen on KZbin. Great job. I just subscribed.
@mythilikalidasan3 жыл бұрын
Most wanted tutorial from you!!! Thanks :)
@jilliansechrest59062 жыл бұрын
You are a phenomenal instructor - you saved my behind in data structures and algorithms and this was a great refresher on lambdas.
@KMJMusic2 жыл бұрын
Wow, i've never understand lambdas that well, but rn, i am happy that i can make my code workflow easier, and shorter! thank you for your great tutorial
@suwatchainanchai6637 Жыл бұрын
It really feels good when understanding more about how it work when I literally use it everyday especially in java stream. The Best Explaination I can find in YT. Thanks alot
@JayantBhalerao-lf9wj7 ай бұрын
You are a very impressive tutor, you make the complex topics very simple and make the students understand the concepts step by step and that too in a very simplified manner with appropriate hands on coding examples. Thanks a lot for all your tech videos and everything you do.
@largeshark9021Ай бұрын
Dude! Thank you for making this, you make problems really simple and you go through and in depth even on things that aren't the main topic. Seriously well made video, thank you.
@oleksandr32752 жыл бұрын
Thanks to your video, i could understand bascis of lambda. I could catch every info you provided, but couldn't understand from other sources. Thank you so much !
@janmour80895 ай бұрын
Finally a human explanation ! Thank you so much !
@fernandobondar71059 ай бұрын
Just blow my mind. Finally can understand the sintax behind the lambda
@JohnDoe-ux7hl2 жыл бұрын
Oh thanks, i'm starting with lambda and this video was perfect. You are amazing.
@kiraalberiti7609 Жыл бұрын
The best explanation i heard until now
@khiemdo55273 жыл бұрын
Waiting for this topic for a long time, and it has been delivered more than enough. Thanks John so much
@ilunghi3 жыл бұрын
+1, he's totally nailed it once again
@JustinBieberFanSA2 жыл бұрын
This is a great explanation of Lambdas. Thank you, I have been a java dev for the last 9 years, I have never used functional interfaces or lambdas in a professional setting but I am getting ready for my OCA certification and this is an amazing explanation. This is the first time that someone has explained it in a way that made sense to me. I am most definitely going subbing to the channel.
@technics62152 жыл бұрын
The best lambda explanation ever. Thank you!
@misaelpereira96793 жыл бұрын
Never have seen a so clearly explanation about java lambdas. You rock!
@micleh3 жыл бұрын
Awesome. You succeed in summarizing the entire topic of the video in 30 seconds at the end, starting from 12:15. I learned a lot. I've never looked behind the scenes of lambdas so far, but just accepted the shortcuts they provide. I have no idea whether method references are worth tackling as well, but if they are, I'd very much enjoy a video on them. I've been looking forward to a new video since your last video, and this one has been totally worth waiting for. Thanks so much!
@ShinMugenNoKabe3 жыл бұрын
Great video as always Mr John, lambdas been a pain in the ass for a junior developer like for long long time and I do gotta say that I'm addicted to your videos as I learned better than in my school
@slhx89562 жыл бұрын
I am in my last semester as a cs major. You explain these concepts so well; maybe even better than my professors, and they are all really smart people!
@saravanaljku51010 ай бұрын
00:03 Lambdas in Java 01:41 We can create a cat object and call the print method on it. 03:20 Using lambdas to pass method implementation as a parameter 04:55 Lambdas in Java allow method implementations to be saved as objects. 06:36 The printable interface's print method can take a parameter called 'suffix' 08:07 Implementing a lambda expression for a method with parameters and return type in Java 09:45 Functional interfaces have exactly one abstract method 11:29 Lambda expressions allow implementation of only one method in an interface with one abstract method.
@backtashmohammadi22315 ай бұрын
I am really impressed by how good you explain each method. THANK YOU
@pedroalbertogomes38092 жыл бұрын
I discovered this channel today and already watched about 7 videos. Amazing! Thanks
@arpanchakraborty98748 ай бұрын
Been a while i have done OOPS. Doing more of cloud coding in azure where we are using lambda expressions. Came back to check this out and i feel like goimg back to developer role. Thanks so much. You really made it as simple as you could
@lemonghost55912 жыл бұрын
Absoultly clear and concise! Thanks alot!
@dannggg2 жыл бұрын
couldn't understand from all the stack overflow explantion. drove me nuts. watch you video once and understood. This aitn the first time your videos do this I feel like everytime I watch your videos I only have to watch it once to get the picture lol..thank u john
@ReBufff3 жыл бұрын
This guy is on fire, every single video he posts is interesting and informative. I wonder how long he can keep this up!
@tarifhalabi3 жыл бұрын
Clear, concise and to the point. Nice video John.
@sftmain2 жыл бұрын
I find it amazing how I'm taking an advanced java course in college right now and these videos are literally covering topics we're going over. Just have to say you do an amazing job btw, literally learn more in these 12 minute videos then I do in 2 hour long lectures. THANK YOU!
@curtisdevine2953 Жыл бұрын
This was an excellent video! I have struggled to understand lambdas for a while and you just connected all the pieces that reading documentation and running examples cannot. Thank you!
@xugefu2 жыл бұрын
Thanks!
@susanthapathirana9195 Жыл бұрын
This simple and best video to understand lambda. Good one John.
@HassanAlavinezhad-c5v Жыл бұрын
thanks a lot. great: as you said "Lambda is a shortcut to defining an implementation of a functional interface", this sentence is all about lambda. thank you.
@christianbarnay249911 ай бұрын
Which can be implemented as a static method. Lambdas are just a way to write unnamed functions and make debugging harder.
@KRaJWanders7 ай бұрын
one of the best videos on Lamda Short and to the point Thanks @CodingWithJohn
@danteUp9 ай бұрын
Amazing video. Clear and precise. Thanks for that
@MGtvMusic2 жыл бұрын
This channel is a goldmine
@ivan-Croatian Жыл бұрын
Amazing explanation. When someone has the ability to explain such abstract example so smoothly that even the absolute begginer could understand it, that means that the person has huge knowledge about that matter. Thanx!
@Preelu10 ай бұрын
Thank you for this tutorial! Now, I understand lambda in Java.
@andrezanlorensi2 жыл бұрын
Thank you now i finally understood how lambda works.
@pinolskun87642 жыл бұрын
This is better then other courses you have to pay a premium for, your explanations are so evidently thought out in a clear to understand manner for the listener and that's absolutely beautiful. Thank you :)
@shounaksengupta21542 жыл бұрын
in awe of the quality.
@ЕкатеринаСекретарева-м9м2 жыл бұрын
The best explanation of lambdas! Thank you so much🙏
@elairyx3 жыл бұрын
Oh yes, thank you so much for this video! I looked at many articles before etc. but couldn't really grip the entire thing or couldn't remember how to use them - now I can :)
@ashuiet3 жыл бұрын
Very clean explanation !! Thanks @Coding With John.
@pattyboi552 жыл бұрын
I have been watching your videos for a while and I have to say you are an excellent resource. You explain in such an intuitive way. Now when I don't understand a concept, I check if you have done a video on it first. Thanks for all you do!
@gonsalomon3 жыл бұрын
Awesome. Now not only JavaScript has arrow functions, but also Java. It's lovely for someone working on web development as well.
@omkardeshpande96403 жыл бұрын
John hats off to your simplicity explanation. You have excellent command in your communication. 👏
@jalilhasanli55772 жыл бұрын
Thanks a lot mate! I knew those things you were talking about. Just watched to see if you explain properly, and I can surely say that it was perfect. I will watch other tutorials you posted to learn even more.
@actualprogramming3 жыл бұрын
Hey Jhon, A humble request, can you please go in depth and explain the difference between Abstract Class and Interfaces. Which one to you use when, and why to even use 1 at the first place. Also, after the introduction of default,static and private also I guess. What exactly is the difference now.
@dumpsockpuppet56193 жыл бұрын
Basically an abstact class is...well, a class, in this case, one that is designed to be inherited, you put the basic atributes, and then each subclass does extra stuff and maybe change's some basic atribute For example, Dog, ,whale,goat, Bat, Human and bear are all mammals, they all have hot blood, have some form of fur, and females feed their offspring milk, but the dog barks, the whaleives in the water, the goat climbs steep surfaces, the bear hibernates, the bat has a sonic radar and the human stands on two legs Meanwhile an interface can be considered either an addon or an common atribute between things that are not related or achieved in completely different ways For example, a bat, a hummingbird, a dragonfly a plane, hellicopter and a rocket all can fly, but do so in completely diferent ways, a bat's wings are just mutated giant hands that they still use grab things or themselves to surfaces, the hummingbirds have speciallized wings that allow tgem fine control of their angle and speed so they can hover, dragonflies have their four wings as extra appendages instead of being their "arms" , hellicoptets push air vertically to lift their weight while planes push it horizontally to gain speed and they win height by shanging the air pressure between the higher and lower parts with the dessign of the wings, an finally a rocket is basically a controlled explossion
@TechSY7302 жыл бұрын
Mechanically speaking, the biggest differences between interfaces with default methods and abstract classes is that abstract classes can declare visibility other than public (e.g. protected abstract methods are a common pattern), and they can have state (variables) of their own. For example, AbstractCollection could be turned into an interface with default methods just fine. As it only has methods, no state (and frankly I'm a bit disappointed they didn't just fold it into the Collection interface). However, AbstractList could _not_ be. As it has a protected method (removeRange) and internal state (the number of modification tracking thing)
@paulmanuilenko78942 жыл бұрын
The greateіt explanation what i have ever seen! There is a lot of information in such a short video. My gratitude to you knows no bounds. Really thank a lot!
@gtiradob6 ай бұрын
Let me say that in my own words: a lambda is an implementation of the only abstract method on a functional interface. With this, we avoid building a class that implements that interface and the objects associated with it. OMG! Thank you for explaining how that works behind the scenes.
@annakohlbecker16282 жыл бұрын
1:47 love it🐱
@rlasc843 жыл бұрын
Hi John. Your videos are making me consider use java again in my projects
@lovsol08 ай бұрын
My java course teacher telling us how we shouldnt use youtube to learn Java, only his lectures. Yet he failed to explain a lot of concepts like lambda and here I learn them in 13 minutes
@cr84442 жыл бұрын
Again! my subscription to your channel is never a waste. God you are such a good teacher!! Thank you again for this 💃💃💃
@kevin_mitchell5 ай бұрын
1:48 "But also we have down here we have this method printThing." With all the boiler plate code auto-generated by IDE's, maybe you should clarify that you created this method as opposed to it being auto-generated when the IDE created the interface, because that's how it-comes across as, "Oh surprise surprise, look what we have down here, a method printThing. I wonder where that came from?"
@babonneau Жыл бұрын
I thought that it was going to be a music tutorial from the background in your first seconds of video! Cool to watch a clever Java tutorial from a developer also playing music ;-)
@aryanjoshi97039 ай бұрын
As usual the best Explainer ,Love from India
@vicke9093 жыл бұрын
I was looking through you channel like 2 days ago to see if you made a tutorial about since i have it in school right now and 2 days later u upload it. THANK YOU :D
@johnsavard62692 жыл бұрын
Great video, easy to understand Java tutorial, not a simple thing to find. You earned my subscription.
@AlexRubyTV2 жыл бұрын
Thank you so much for the explanation! This is the best video on lambda topic that I ever seen. It is very clear and straightforward.
@chrisbrownbridge58852 жыл бұрын
First video I've watched of yours and I am beyond impressed! You explain things so perfect and clear which allowed me to understand it all so much easier! Definitely watching the rest of your vids! Amazing teacher!
@Rasmusorum2 жыл бұрын
best programming teacher
@moyolinux2 жыл бұрын
not bad quick and insightful, defiantly helps with the lambdas section on headfirst java