Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What does <?> represent in generics?
Think about flexibility in type.
In the context of wildcards, what does 'extends' signify?
Consider when reading types.
What wildcard allows any type?
Think about 'flexibility'.
True or False: The syntax <? extends Number> allows reading elements that are of type Number or its subtypes.
Think about types of numbers.
Write a method that accepts a list of any type using an unbounded wildcard and calculates the total number of items added to the list. How would you approach it?
Focus on the size of the list.
Create a utility function that adds items of type T to a list that accepts upper bounded wildcards. Provide an example of its usage.
Think of the method signature and its parameters carefully.
6 more questions in this section. Enroll free to practise them all.
Enroll free