Lower Bounded Wildcard Type QuizS2C Home « Lower Bounded Wildcard Type Quiz

Generics Quiz 8

The quiz below tests your knowledge of the material learnt in Generics - Lesson 8 - Lower Bounded Wildcard Type.

Question 1 : The following code snippet is an example of a lower bounded wildcard type?
<? super Number>
- <code>? super Number</code> IS an example of a <i>lower bounded wildcard type</i>.
Question 2 : Is the following code snippet valid?
<? super Object>
- <code>? super Object</code> IS valid but would only allow the <i>Object</i> type and is not recommended when using a <i>lower bounded wildcard type</i>.
Question 3 : If we had a scenario where we only want a method to work on a particular class or superclasses of it which generic type would we use?
- If we had a scenario where we only want a method to work on a particular class or superclasses of it we would use the generic <i>lower bounded wildcard type</i> type.
Question 4 : Which reserved word is used with with a lower bounded wildcard type ?
- The <code>super</code> reserved word is used with with a <i>lower bounded wildcard type</i>.
Question 5 : Lower bounded wildcard type checks always allow for the Object type?
- Lower bounded wildcard type checks DO always allow for the <code>Object</code> type as it is the <i>superclass</i> of all objects.
Question 6 : The following code snippet is an example of a lower bounded wildcard type?
<? extends Number>
- <code>? extends Number</code> IS NOT an example of a <i>lower bounded wildcard type</i> but an <i>upper bounded wildcard type</i>.
Quiz Progress Bar Please select an answer


What's Next?

In the next quiz we test your knowledge of generic methods.