AP Computer Science Amediummcq1 pt
If Animal a = new Dog() and Dog overrides speak, then a.speak()
A.calls Dog's speak
B.calls Animal's speak
C.fails to compile
D.calls Object's speak
Dynamic dispatch uses the object's class.
Acalls Dog's speak
Practice more AP Computer Science A questions with full explanations
Practice Unit 9: Inheritance Questions →