Skip to content

[item42] 람다에서의 this 키워드는 바깥 인스턴스를 가르키는 이유 #65

@jun108059

Description

@jun108059

#61 (comment)

258p
람다에서의 this 키워드는 바깥 인스턴스를 가르킨다.
반면 익명 클래스에서의 this는 익명 클래스의 인스턴스 자신을 가르킨다.

람다도 익명 객체인 것 같은데 this 키워드가 바깥 인스턴스를 가르키는지 이해가 안되네요ㅠㅠ

혹시 힌트가 있을까 하고 컴파일된 클래스 파일을 열어봤는데 궁금증 해결이 안됐습니다..

image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions