Loading…
Loading…
Ten exam-style questions on record patterns: deconstruction with instanceof, component count, order and types, run-time matching of nested types, null components, nested patterns, var and generics, and record patterns in switch, with explanations.
Practice questions for the article Java Record Patterns: Deconstruction, Nesting and switch.
Check each pattern in two stages: does it compile (shape and compatible types), and does it match at run time (actual values)? Aim for at least 8 out of 10.
Quiz path: step 48. Take the quizzes in this order, after reading each article.
Previous quiz: Records (OCP 21)
Next quiz: Inner and Static Nested Classes (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.