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

12 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+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions