000001 Chapter Notes -Code Reuse, Scrollbar, Abstract Window Toolkit

13 views5 pages

Document Summary

Drawableobject, multipointobject, and twopointobject would be classes in the program. Multipointobject and twopointobject would be subclasses of drawableobject. Line would be a subclass of twopointobject and (indirectly) of drawableobject. A subclass of a class is said to inherit the properties of that class. The subclass can add to its inheritance and it can even override part of that inheritance (by de ning a di erent response to some method). Nevertheless, lines, rectangles, and so on are drawable objects, and the class drawableobject expresses this relationship. Inheritance is a powerful means for organizing a program. It is also related to the problem of reusing software components. Not only can it be reused directly if it ts exactly into a program you are trying to write, but if it just almost. Ts, you can still reuse it by de ning a subclass and making only the small changes necessary to adapt it exactly to your needs.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions