#73 Lambda Expression in Java

  Рет қаралды 84,214

Telusko

Telusko

Жыл бұрын

Telusko Courses:
Spring and Microservices Live Course : bit.ly/springmslive
Coupon: TELUSKO25 (25% Discount)
Industry-Ready Java Spring Microservices Developer Live : bit.ly/JavaMS2
Complete Java Developer Course : bit.ly/Comp-Java-Dev-2
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
Java For Programmers:- bit.ly/javaProgrammers
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
In this lecture, we are discussing lambda expression:
#1 what is lambda expression in java?
-- In Java, a lambda expression is a concise way to implement a functional interface.
A functional interface is an interface that has only one abstract method, and it can be implemented using a lambda expression.
-- In the previous lecture we see that we are making a class or inner class to implement the functional interface
but using lambda expression we do not need of new class and inner class to implement.
#2 Properties of the lambda expression
Concise syntax: Lambda expressions provide a concise and expressive syntax for defining functional interfaces.
They allow you to define the behaviour of a functional interface in a single line of code.
Functional programming: Lambda expressions are a key component of functional programming in Java.
They allow you to write code that is more declarative and expressive, and less verbose than traditional imperative code.
No need for anonymous inner classes: Lambda expressions provide an alternative to anonymous inner classes, which are often
used to implement functional interfaces in Java. Lambda expressions are more concise and easier to read than anonymous inner classes.
#3 example:
class Main{
public static void main(String []args){
A obj = new B();
obj.show();
//another way to implement functional interface
A obj1 = new A(){
@Override
public void show(){
System.out.println("Hello");
}
};
obj1.show();
//now we can use a lambda expression to implement the functional interface
//you can remove new A() and public void show() and replace it with () -grater then System.out.println("Hello");
//if you have single statements you need not mention curly braces and return keyword
A obj2 = () - grater then System.out.println("Hello");
obj2.show();
//here you can use lambda expression to implement interface C
C obj3= i-grater then System.out.println(i);
obj3.show(5);
}
}
//one way to implement functional interface
class B implements A{
@Override
public void show(){
System.out.println("Hello");
}
}
//specify it is functional interface
@FunctionalInterface //we use this annotation to specify it is functional interface
interface A{
void show();
//void run(); //this will give error as it is not functional interface
}
interface C{
public void show(int i);
}
Github repo : github.com/navinreddy20/Javac...
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 29
@user-zx3so5do1b
@user-zx3so5do1b 9 ай бұрын
I cannot believe this amazing lecture is just for FREE... thank you, sir. You made the world smarter!
@StudyStuff-pk7gv
@StudyStuff-pk7gv 6 ай бұрын
you make this complex thing look so simple..huge respect for you
@akej2463
@akej2463 Жыл бұрын
1:25 Gave me a much better look at lambas, cool video
@addytechie6948
@addytechie6948 4 ай бұрын
[00:00] Lambda expressions in Java simplify instantiation of functional interfaces. [01:37] The arrow in Lambda expressions replaces the need for writing the entire method body. [02:31]Lambda expressions are syntactic sugar, reducing code by simplifying the instantiation of functional interfaces. [03:56]Lambda expressions can handle parameters, and you can skip mentioning the variable type and use shorthand syntax. [05:45]) Lambda expressions save on file creation, reducing the number of generated class files.
@alexandrumuhulica6665
@alexandrumuhulica6665 4 ай бұрын
So simple and compact, finally I understood this! Thank you
@ShanSiraj
@ShanSiraj 7 ай бұрын
excellent simplification, Thanks
@lesterjayabiad3347
@lesterjayabiad3347 6 ай бұрын
thanks for sharing free knowledge sir.
@NiveditaUmasankar
@NiveditaUmasankar 3 ай бұрын
Thank you for simplifying Lambda. One of the clearest explanations
@vengateshan7800
@vengateshan7800 3 ай бұрын
Sir , your way of explanation is awesome and quickly understandable. Please keep post more videos 👍
@ukaszkiepas57
@ukaszkiepas57 8 ай бұрын
thank you mate !!!!
@revan_hajiyev
@revan_hajiyev 3 ай бұрын
thanks for the explanation teacher by the way ) good and smooth with your humorious speaking )
@yousufbaig821
@yousufbaig821 4 ай бұрын
Beautifully explained !! Next time I visit Hyderabad I wanna host you a biryani treat :)
@movietrailer3616
@movietrailer3616 5 ай бұрын
Where is the complete Playlist of this series I can't find
@rutukeshparmaj2068
@rutukeshparmaj2068 2 ай бұрын
Thank You❤
@AK-tt7fc
@AK-tt7fc Ай бұрын
Hi , here we dont need implements keyword . kindly any one clarify on this .
@sitharainfotechnologies304
@sitharainfotechnologies304 Жыл бұрын
hi bro on above if Interface you mentioned FunctionalInterface right that is why bro? can you please help me to understand that Thanks C Ashoka
@harisahmad7871
@harisahmad7871 Жыл бұрын
A FunctionalInterface is an interface with only one method
@sife1808
@sife1808 Жыл бұрын
@@harisahmad7871 Only one abstract method to be precise. It may or may not have default methods.
@koyacrab
@koyacrab 8 ай бұрын
its an annotation, watch the vid right before this one in the playlist
@user-eo6sv1gs7p
@user-eo6sv1gs7p 3 ай бұрын
how to chat arrow like that ?
@puruagni1927
@puruagni1927 5 ай бұрын
I liked the lecture, but when you said shorter code syntactical sugar I couldn't help myself from laughing being a python programmer 😂😂. But then again, great lecture!
@revan_hajiyev
@revan_hajiyev 3 ай бұрын
lol: Java says: hey, don't worry i am there )))
@jyotiradityatripathi6095
@jyotiradityatripathi6095 17 күн бұрын
@samartajshaikh2601
@samartajshaikh2601 5 ай бұрын
again a cliffhanger at the end. This is good though, you are keeping every video limited to one crucial lesson.
@Moinshaikh611
@Moinshaikh611 7 ай бұрын
I came from javascript background It's similar to arrow function 😅
@Thunder_Venom
@Thunder_Venom 4 ай бұрын
yaa bro
@yousufbaig821
@yousufbaig821 4 ай бұрын
Achieving python using Java 🤣😂
@Kings238
@Kings238 2 ай бұрын
ho pretty
#74 Lambda Expression with return
3:18
Telusko
Рет қаралды 45 М.
Functional Interface | Lambda Expression in Java
13:56
Telusko
Рет қаралды 132 М.
Sigma Girl Education #sigma #viral #comedy
00:16
CRAZY GREAPA
Рет қаралды 14 МЛН
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 9 МЛН
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 681 М.
GPU optimization workshop (hosted by @ChipHuyen )
MLOps Learners
Рет қаралды 807
#83 User Input using BufferedReader and Scanner in Java
11:48
#40 Encapsulation in Java
11:42
Telusko
Рет қаралды 127 М.
Java Anonymous Inner Classes Explained in 6 Minutes
6:27
Coding with John
Рет қаралды 90 М.
Stream API in Java
26:04
Telusko
Рет қаралды 262 М.
Java lambda λ
18:00
Bro Code
Рет қаралды 86 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 691 М.
#71 What is Annotation in Java
7:32
Telusko
Рет қаралды 55 М.
Готовый миниПК от Intel (но от китайцев)
36:25
Ремонтяш
Рет қаралды 438 М.
Чем отличается OLED от AMOLED?
0:43
Не шарю!
Рет қаралды 99 М.
Переходник для IPhone • 181649538                         Делюсь обзорами в профиле @lykofandrei
0:15