12.4 Summary


12.4 Summary

Inheritance is a vertical relationship among classes. This relationship enhances class reuse. A subclass (derived class) inherits all the features of its base (parent) class. Only the public and protected features can directly be accessed by the base class. The initializer (constructor) functions of the base class are not inherited; all classes are responsible for defining their initializer functions.

A subclass can be an extension and/or a specialization of the base class. If a subclass defines new features in addition to the ones that it inherits from the base class, then the subclass is said to be an extension to the base class. If a subclass redefines (overrides) one or more functions of the base class, then the subclass is said to be a specialization of the base class. The UML class diagrams show the inheritance relationships.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

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