AP Computer Science Aeasymcq1 pt
If class B extends A, the statement A x = new B() is
A.legal
B.a compile error
C.a runtime error
D.only legal with a cast
A subclass object fits a superclass reference.
Alegal
Practice more AP Computer Science A questions with full explanations
Practice Unit 9: Inheritance Questions →