Question: Consider the following class definitions. public class Thing { /* implementation not shown */ } public class MoreThing extends Thing { /* implementation not shown

Consider the following class definitions. 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(); W/ line 3 MoreThing t3 = new MoreThing(); arro] = t1; // line 5 arr[1] t2; w/ line 6 arr[2] w/ line 7 +3; Which of the following best explains the error in the code segment? Which of the following best explains the error in the code segment? Line 1 will cause an error because the type used to declare arr and the type used to instantiate arr are different, Line 3 will cause an error because the type used to declare t2 and the type used to instantiate t2 are different Line 5 will cause an error because the types of arroj and t1 are different Line 6 will cause an error because the types of acr|11 and t2 are different. E Line 7 will cause an error because the types of arr12) and t3 are different
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
