Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is an unbounded wildcard?
Think about generic lists.
Write a method that accepts any list using an unbounded wildcard.
Consider how to indicate no type restriction.
What is the purpose of an unbounded wildcard in Java?
Consider the flexibility allowed without specific criteria.
True or False: Lower bounded wildcards allow the specified type and its subclasses.
Reflect on the generalization vs. specialization.
Write a generic method using an upper bounded wildcard that takes a list of Animals and returns the count of Dogs in it.
Consider type-checking when counting objects.
Create a method to add objects of any superclass type to a list of Integer, including handling exceptions if added wrongly.
Think carefully about what type checks you need to ensure insertions are type-safe.
5 more questions in this section. Enroll free to practise them all.
Enroll free