public class Thing { /* implementation not shown */ } public class MoreThing extends Thing { /* implementation not shown */ } The following code segment appears in a class other than Thing or MoreThing.
Thing[] arr = new MoreThing[3]; // line 1 Thing t1 = new Thing(); Thing t2 = new MoreThing(); // line 3 MoreThing t3 = new MoreThing(); arr[0] = t1; // line 5 arr[1] = t2; // line 6 arr[2] = t3; // line 7
Which of the following best explains the error in the code segment?
A. Line 1 will cause an error because the type used to declare arr and the type used to instantiate arr are different. B. Line 3 will cause an error because the type used to declare t2 and the type used to instantiate t2 are different. C. Line 5 will cause an error because the types of arr[0] and t1 are different. D. Line 6 will cause an error because the types of arr[1] and t2 are different. E. Line 7 will cause an error because the types of arr[2] and t3 are different.