You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
자바에서의 람다식이나 익명 함수에서는 final이거나 effectively final인 외부 지역 변수만 접근할 수 있습니다.
하지만 코틀린의 람다식이나 익명 함수에서는 굳이 final이 아니더라도 (val이 아니더라도) var로 선언된 지역 변수에 접근할 수 있는 것을 볼 수 있습니다.
자바에서는 안 되는데 어떻게 코틀린에서 할 수 있는 것일까요?