← Quiz: Nested and Anonymous Classes: all 10 questions
Quiz: Nested and Anonymous Classes · Question 4 of 10
What does "effectively final" mean for a local variable used inside a lambda?
What does "effectively final" mean for a local variable used inside a lambda?
- A.It is never changed after it is first assigned
- B.It must be declared with the final keyword
- C.It must be a static field
- D.It can be changed only inside the lambda
Answer & explanation
Correct answer: It is never changed after it is first assigned
The final keyword is optional; what matters is that the value never changes.
Can you get the rest right without peeking?
Take the timed Quiz: Nested and Anonymous Classes quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →