Page 588 - AP Computer Science A, 7th edition
P. 588
(D) I and II only (E) I and III only
7. Consider the following inheritance hierarchy.
Which of the following declarations will not cause an error? You may assume that each of the classes above has a default constructor.
I WheatCereal w = new Cereal();
II Cereal c1 = new Cereal();
III Cereal c2 = new RiceCereal();
(A) I only
(B) II only
(C) III only
(D) I and III only (E) I, II, and III
Questions 8 and 9 refer to the following class definitions.
public interface Class1 { void method1(); }
public class Class2 implements Class1 {
public void method1()