go to previous page   go to home page   go to next page highlighting

Answer:

ConceptParent Class, Child Class, or Interface?
Goods Parent Class
Food Child Class
Toy Child Class
Book Child Class
Taxable Interface

Picture of the Classes

various goods as children of Goods

Here is a picture that shows the classes and the interface. The children classes extend their parent. This is shown with a solid arrow pointing at the parent.

The solid arrows show inheritance. The three children inherit the display() method from their parent, Goods.

Two of the classes implement the interface. This is shown with a dotted arrow pointing at the interface.

The dotted arrows show what a class must implement. The Toy and Book classes must implement the calculateTax() method.


QUESTION 7:

According to the picture,


go to previous page   go to home page   go to next page