AP Computer Science Aeasymcq1 pt

Which is the correct syntax for creating a subclass?

A.public class Dog extends Animal
B.public class Dog implements Animal
C.public class Dog inherits Animal
D.public Animal extends Dog

Explanation

Core Concept

extends links the classes.

Correct Answer

Apublic class Dog extends Animal

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 →