🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It is never changed after it is first assigned
  2. B.It must be declared with the final keyword
  3. C.It must be a static field
  4. 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 →