AP Computer Science Amediummcq1 pt

If Dog overrides speak and also defines bark, then an Animal reference to a Dog

A.can call speak but not bark
B.can call bark but not speak
C.can call both
D.can call neither

Explanation

Core Concept

The reference type limits visible methods.

Correct Answer

Acan call speak but not bark

More Unit 9: Inheritance practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 9: Inheritance Questions →