effectively final1 람다식 로컬 변수 - Effectively Final Effectively Final Java8에서 final이 붙지 않은 변수의 값이 변경되지 않는다면, 그 변수를 Effectively final이라고 합니다. 람다에서는 사용할 수 있는 로컬 변수는 Effectively Final만 사용이 가능하다. public class EffectivelyFinal { public static void main(String[] args) { new Pint().go(); } } class Pint { void go() { int baseAnInt = 111; Function function = (num) -> num + baseAnInt; System.out.println(baseAnInt+"baseAnInt"); System.out.println(function.a.. 2023. 1. 28. 이전 1 다음