Given:
2. import java.util.*; 3. class Shape { } 4. public class Square extends Shape { 5. public static void main(String[] args) { 6. List<Square> c0 = new List<Square>(); 7. List<Shape> c1 = new ArrayList<Shape>(); 8. List<Shape> c2 = new ArrayList<Square>(); 9. List<Square> c3 = new ArrayList<Shape>(); 10. List<Object> c4 = new ArrayList<Square>(); 11. ArrayList<Shape> c5 = new ArrayList<Square>(); 12. } //from w ww.j a va 2 s . c om 13. }
Which are true? (Choose all that apply.)
B, D, E, F, and G are correct
B, D, E, F, and G are correct because those lines of code will NOT compile.
B, (line 6), is incorrect because List is abstract.
D, E, F, and G are all incorrect because polymorphic assignments can't be applied to the generic type parameter.
C is incorrect because line 7 uses legal syntax.