Class Declarations public class Parent public void namel System.out.println("Parent"); d public void age { Systen.out.println("Old"); 1 } public class Child extends Parent { public void name() System.out.println("Child": ) public void age System.out.println("Young) } public void grade() System.out.println("10"): Which of the following statements will cause a compile time error? 1. Parent person = new Child(); person.grade(): 2. Child person = new Child(); person.grade(): 3. Parent person = new Parent(): person. age(); 4. Parent personne Child(): personage(): 66% canvas instructure.com Consider the following class declarations public class Park { private String name; public Park(String name) this.name = name; > public String toString() return name + park"; } } public class Field extends Park { private String type; public Field(String name, String type) { super (name); this.type type; ) public String toString() return super.toString() + " with a " + type="field" > A code segment located in a different class produced the following output Centennial park with a soccer field Which of the following code segments will produce that output? 66% canvas.instructure.com produced the Tollowing output Centennial park with a soccer field Which of the following code segments will produce that output? 1. Park cent = new Park("Centennial", "Socc er"); System.out.println(cent); II. Park cent = new Field("Centennial", "soc cer"); System.out.println(cent); III. Field cent = new Field("Centennial", "so ccer"); System.out.println(cent); Only II Only Ill only Il and Ill Only Question 8 1 pts Consider the following class declarations public class Car { * Implementation Not Shown / } public class ElectricCar extends Car /* Implementation Not Shown */ } The following line of code appears in a test class: ArrayList
Which of the following objects can be added to the ArrayList? I. Car leat = new ElectricCar(); II. Car mustang = new Car(); III. ElectricCar model3 = new ElectricCar(); 1 Only I and II only I and Ill only Ill only OIHI, III Question 9 1 pts Which of the following is the best example of a Superclass / Subclass relationship? Balloon / Color Team / Mascot Student / Grade Shirt / Button Fruit / Banana