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 does 'T extends Number' signify in a generic class?
Think about what types can be subclassed from Number!
Is it possible to instantiate a Stats class with String as a parameter?
Consider the restrictions imposed by 'extends'.
What is the purpose of bounded type parameters in Java?
Think about what 'extends' means in a class definition.
True or False: A list of type List
Consider the rules of inheritance.
Create a generic class that accepts numbers representing different statistical measures (mean, median, mode) and implements methods to compute each measure.
Consider what methods are available on Number classes.
Imagine you are modeling a library system where books might be of different types. Can you create a generic solution that works for any type of Media, but ensures that only media classes are allowed?
Think about how you could apply constraints effectively.
5 more questions in this section. Enroll free to practise them all.
Enroll free