A Simple Inheritance Example


Expressing Generalization & Specialization In The UML

Generalization & specialization relationships can be expressed in a UML class diagram by drawing a solid line with a hollow-tipped arrow from the derived class to the base class as figure 11-2 illustrates.

image from book
Figure 11-2: UML Class Diagram Showing DerivedClass Inheriting From BaseClass

Referring to figure 11-2 — the BaseClass class acts as the direct base class to DerivedClass. Behavior provided by BaseClass is inherited by DerivedClass. Let’s take a look at an example program that implements these two classes.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net