Java 8 Lambda Basics 20 - The this reference in lambdas

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

We'll now look at an important distinction that separates lambda expressionsn from anonymous inner classes - the meaning and value of the 'this' reference.
Рекомендации по теме
Комментарии
Автор

Really awesome Tutorials on Lambda! Thanks Koushik!


Just to add a small point on the subject, if we take a look at the compiled .class files, we could see that Lambdas as never converted to .class files. At the same time we can see Anonymous inner class getting converted to individual .class files. This behavior can be correlated to the fact that Lambdas are not syntactical sugar over anonymous inner class, but a different thing on its own.

dennyjames
Автор

Sir ji awesome! I came to this clip from your fist clip from this tutorial series.

readerwriter-gfiy
Автор

Wow after spending 1.5 yrs in java today I got to learn something new about lambda

botrate
Автор

You are very awesome ! I'm learning so much from you !
Thank you so much.

elmehdisaniss
Автор

that's why anonymous classes and lambdas are different things

rookiecookie
Автор

actually when you see the .class files, we wont see any inner class starting with $.. that explains lambda are not converted as anaynomus inner class

kumarvishal
Автор

Awesome videos! Please prepare advance lambda

onlinetvoffical
Автор

Can you please upload a course related to streams, Grouping and ParallelStreams ?

ramlakhan-fpct
Автор

Can you please create a video on datadog configuration.

kidslearningscience
Автор

this reference behaves in the same way in javascript lambda functions(anonymous functions) as well.

kapilthukral
Автор

one Question even when you print this object in the Anynomus Inner class it prints ThisReferenceExample only not the Process Object could you please check that

yashkumarm
Автор

These videos are awesome really.

I just have one small question in this video and hope someone sees my comment.

In demonstrating the anonymous inner class with "this" reference ( before adding the toString method override), why it prints an instance of ThisReferenceExample class, not the inner class (on 3:49)?

adelsalaheldeen
Автор

Uff the javabrains.io link seems to be down.

perschistence
Автор

public class ThisReferenceExample{
public static void main(String[] args) {
Process w=new Process() {
@Override
public void process(int i) {
// TODO Auto-generated method stub
System.out.println(this);
}
};
w.work(0);
}
}
This example is also printing the reference to ThisReferenceExample. Does interfaces when directly implemented as anonymous inner class, also not touch the "this" reference?

amitmahto
Автор

Excellent Request you to add one more playlist on streaming in details would be highly appreciated.

sonaraw
Автор

Please can anyone explain why it's not a static method anymore? 7:25

JaspreetSingh-wlui
Автор

can anyone please suggest a tutorial on Spring Boot

csamarnathreddy
Автор

Awesome video, but no doubt why java is lagging behind Python, when python is bringing new API wrt AI, ML, DS java is focussing on this nonsense stuff of rewriting same stuff in different way.

satyas
Автор

Great work, really useful, I've just one comment or advice, try to make the video shorter by focusing on the important parts, with all my respect

emadrefai