Loading…
Loading…
Ten exam-style questions on lambda parameter type inference, var and final parameters, consistent parameter formats, locals inside lambda blocks, name clashes, and effectively final captures of locals and parameters versus fields, with explanations.
Practice questions for the article Java Lambda Variables: Parameters, Locals and Effectively Final Captures.
For each variable a lambda uses, ask: is it a field, or a local or parameter? If it's a local or parameter, look for any reassignment in the whole method. Aim for at least 8 out of 10.
Quiz path: step 58. Take the quizzes in this order, after reading each article.
Previous quiz: Convenience Methods and Primitive Functional Interfaces (OCP 21)
Next quiz: Chapter 8 Review: Lambdas and Functional Interfaces (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.