Java 8 Method and Constructor References: Simplifying Code and Boosting Efficiency - Explained!

preview_player
Показать описание


🔴 Video summary
In Java, Method References and Constructor References are shorthand notations for lambda expressions that can be used to simplify the code and make it more readable.

A Method Reference is a shorthand notation for a lambda expression that invokes a method. It provides a way to refer to an existing method by name instead of specifying a lambda expression that defines a new method. Method References are used to simplify lambda expressions that call a single method with a single parameter.

A Constructor Reference is a shorthand notation for a lambda expression that creates a new object using a constructor. It provides a way to refer to an existing constructor by name instead of specifying a lambda expression that defines a new constructor. Constructor References are used to simplify lambda expressions that create new objects.

Method References and Constructor References can be used with functional interfaces, which are interfaces that have a single abstract method. They can be used in place of lambda expressions when the lambda expression is simply invoking a single method or constructor.

Overall, Method References and Constructor References can help to simplify code and make it more concise and readable by reducing the amount of boilerplate code needed for simple lambda expressions.

🔴 Timestamps
Intro 0:00
Рекомендации по теме
Комментарии
Автор

video samapt ho gai he !!... hats off sir !!

fazlurrehmanejazahmad
Автор

I binge watched this whole playlist, thank you for teaching, it was very informative and precise.

rohithguptha
Автор

"Kuch bi samjh me nahi aaya he ", :D lol, so relatable

greymatters
Автор

thanks bhai, for speaking in hindi specially😃

divijbalota
Автор

bro, when I Started watching your video, I was bit annoyed by your speed of speech... but abb habit padd gai sunne ki... and abb sirf hasi ati rehti hai... on ur sense of humor between teaching... and haa kuch bhi samajh nahi aya obviously...

monika
Автор

Sir super u r fabulous, fantastic, unbelievable teaching

mnaresh
Автор

Awesome thanks to youtube algorithm for prompting this channel, super explanation bhai keep rocking

NjoyTheLife
Автор

bro sir mate u cleared my doubt clearly and nicely appreciate

vishalit
Автор

thanks so much sir,
so great playlist sir,

aabajirakate
Автор

copy pasted.
khali phokat ka attitude. is se better explanation youtube me upload hua hai.

anilnayak
Автор

how can we use constructor refence if constructor takes more than one parameter ... and is it possible ? Well thanks for great video

riteshghule_patil