16. Functional Interface and Lambda Expression - Java8 features | Java Interfaces Part3
Вставка
- Опубліковано 8 чер 2024
- ➡️ Notes Link: Shared in the Member Community Post (If you are Member of this channel, then pls check the Member community post, i have shared the Notes link there)
➡️ Join this channel to get access to member only perks:
/ @conceptandcoding
Topics which i have covered in this:
- What is Functional Interface?
- What is Lambda Expression?
- How to use Functional Interface with Lambda expression
- Advantage of Functional Interface?
- Types of Functional Interface?
○ Consumer
○ Supplier
○ Function
○ Predicate
- How to handle use case when Functional Interface extends from other Interface(or Functional Interface)?
Chapters:
00:00 - Introduction
00:47 - What is Functional Interface
06:45 - What is Lambda Expression
15:41 - Types of Functional Interface(Consumer, Supplier, Function, Predicate)
25:52 - Functional Interface extends from other interface Scenarios
Join this channel to get access to perks:
/ @conceptandcoding
#java #softwareengineer
Great content. Just one addition to the built in functions - if you have a requirement where a function should have no arguments and returns nothing (void), you can use Runnable. I think that is another use case of Runnable, apart from threads.
Thank you for this explaining very clearly. The concepts and topics you explain in your video is extremely flawless and with simple examples. Have been following and liking your videos from quite sometime now. Please keep up the great work you are doing.
Thanks
It is beautiful explaination because it is very simple.
Very well explained. I have understood and concept us well understood
clear everything ...great😇😇😍
nice explanation...
If a functional interface (which do not provide any method inside it) extending non-functional interface which has only one abstract method, then this will work right?
One more interesting topic which is method reference could have been explored here in this video.
is it necessary to have generic class in the supplier , consumer type?
Hi Shrayansh, just a doubt at 26:11 , you said that Living Thing is a Non Functional Interface but since it has just one abstract method, it as well is qualified to be a functional interface.Just that there is no @FunctionalInterface annotation on it.Or is it non functional interface because of the presence of public access modifier(which should not be the case as all interface methods are by default public hence making functions Interface's abstract methods public as well.)
I need to check the video, but as per your description, access modifiers is not the reason.
Annotation is not there means it's not a functional interface but till it has only one abstract method, we can use it as a functional interface but there is no control any someone can add another abstract method too.
yes you are right. LivingThing is also a funtional interface. but still Bird Interface can't extends it. bcs Bird Interface is funtional Interface (restricted by @FuntionalInterface) so it can't have more than one abstruct method.
I think Shreyansh has just taken example to give understanding to us. but he can add one more abstruct method in LivingThing interface so it won't confuse others
@@ConceptandCoding "Annotation is not there means it's not a functional interface...."
It fulfills the criteria to be a functional interface. It has SAM. And you yourself said the @Annotation is not mandatory right?
Hi shrayansh, for using lambda expressions, do we need to declare interface as Functional Interface?
Declaring the interface as functional interface is not mandatory, until you have only 1 abstract method.
Hello Sir one question might what should we use with spring boot Gradle or maven in a personal project if I plan to use microservices in that project
Try to use maven. It's very popular among MNCs
hy shryansh, how much time it will take more days to complete java full concepts ? can u tell me date when all completed so that we can move on springboot & microservices
Hi Gnana, currently in a month i am able to upload 6 videos. If i go with the same rate, i think next 2 months we will be in good position with Java. But i can not commit bcoz generally i prepare the content on weekends.
Is it compulsory to use wrapper type variable in parameter, if we make generic type of interface?
Yes.
Amazing video sirji..but before starting system design ....what are the prerequisites? i am covering this java playlist now .....can i start your LLD series after that?
Yes, we are good with starting LLD after you know any OOPs language
Video is uploaded on 17th nov 2023(11 hours ago ). how come your comments are 4 months ago ?? Just wondering
thanks
Hi Shreyansh, Please make video on java 11 features.
Will do, it in my bucket list
Hi Shrayansh, will you be covering stream API also ?
Yes, in collections
Please add notes slide, it is not in the description. It will be very helpful.
Hi Shrayansh, Till when all Java topics will be completing? next 2 months ?
yes, currently our rate of video going is 2 videos per week, if i am able to maintain the same consistency, by next 2 months i will be able to complete the JAVA
@@ConceptandCoding Thank you shrayansh🙏
sir if we become premium member can we access all videos in the channel?
Yes buddy
I understand functional interface, but in real life interfaces will have more than one methods, so using interface with only one method in it rare case know?
Yes generally it's very rare you write your own functional interface, generally we use existing functional interface only
Notes link??
Pls check the description section
@@ConceptandCodingHi Shrayansh, notes are not present in description, please add OneNote slides to help with revision