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

Answer:

Yes.


Advantage of Abstract Classes

holiday card

Abstract classes are used to organize programs. The same program could be organized in many ways. Our example program could be written without an abstract class. But a real-world application might have hundreds of classes. Grouping classes together is important in keeping a program organized and understandable.

Here is a sample run of the program:

Dear Santa,

Season's Greetings!

The advantage of using an abstract class is that you can group several related classes together as siblings. The picture shows this program after its object has been constructed.

In the picture, the abstract class is outlined in a dotted line. The non-abstract class is outlined in a solid line. The single object is shown as a rectangle. (This is not official UML.)


QUESTION 7:

How many Holiday cards can be constructed from the Holiday class?


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