Which, taken independently, are true? (Choose all that apply.)
A. If line 5 is uncommented, compilation fails due to an error at line 7.
B. If line 5 is uncommented, compilation fails due to an error at line 8.
C. If line 5 is uncommented, compilation fails due to an error at line 9.
D. If line 6 is uncommented, compilation fails due to an error at line 7.
E. If line 6 is uncommented, compilation fails due to an error at line 8.
F. If line 6 is uncommented, compilation fails due to an error at line 9.
Answer (for Objective 6.4):
A, B, C, and D are correct. The generic type of the reference <? extends Organic>
says that the generic type of the instantiation can be either Organic, or a subtype of
Organic. Since the compiler doesn’t know this instantiation generic type (runtime type),
it does NOT bind any value to its generic criteria, so A, B, and C are correct. On the other
hand, the generic type of the reference <? super Aliphatic> says that the generic type
of the instantiation can be either Aliphatic, or a supertype of Aliphatic. Although
the compiler doesn’t know the instantiation generic type, it knows that it will be either
Aliphatic, or a supertype of Aliphatic—such types can bind any value that is either
Aliphatic or a subtype of it. Therefore, D is correct.
E and F are incorrect based on the above.
Can anyone please explain the answers to this question? I don't understand the explanation given for this question.