QuestionQ188
Working with InheritanceYou are asked to develop a program for a shopping application and are given the following information:
- The application must include the classes
Toy,EduToy, andConsToy.Toyis the superclass of the other two classes. - The
int calculatePrice(Toy t)method calculates a toy's price. - The
void printToy(Toy t)method prints a toy's details.
Which definition of the Toy class adds a valid abstraction layer to the class hierarchy?
- A

- B

- C

- D

Community Discussion