Loading…
Loading…
Ten exam-style questions on generic invariance, unbounded, upper-bounded and lower-bounded wildcards, what you can add and read through each, PECS, List<?> versus var, and illegal wildcard declarations, with explanations.
Practice questions for the article Java Generic Wildcards: Unbounded, Upper-Bounded and Lower-Bounded Types.
For every wildcard, list the actual types it could stand for, then check that the operation is safe for all of them. Aim for at least 8 out of 10.
Quiz path: step 67. Take the quizzes in this order, after reading each article.
Previous quiz: Generic Classes and Methods (OCP 21)
Next quiz: Chapter 9 Review: Collections and Generics (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.