AP Computer Science Amediummcq1 pt
If class B extends A, the statement B x = new A() is
A.a compile error without a cast
B.legal
C.a runtime error always
D.legal with any object
A superclass object is not a subclass.
Aa compile error without a cast
Practice more AP Computer Science A questions with full explanations
Practice Unit 9: Inheritance Questions →