A lambda body attempts to modify a local variable declared in the enclosing method. What happens?
-
A
The variable is silently copied into the lambda
-
B
A compilation error occurs because local variables captured by lambdas must be effectively final
-
C
The modification is allowed only if the variable is declared volatile
-
D
The JVM creates a new stack frame for the modification