October 2002
Intermediate to advanced
288 pages
5h 4m
English
Specialization provides the ability to create subclasses that represent refinements to the superclass—typically, structure and behavior are added to the new subclass. This method of finding inheritance often comes into play if a class already exists. Subclasses are added to specialize the behavior of an existing class. For example, the registration system could be expanded to allow senior citizens to take classes free of charge. A new subclass called SeniorCitizen could be added to the RegistrationUser hierarchy to hold information pertinent to senior citizens.
Operations may be overridden by a subclass. However, a subclass should never restrict an operation defined in its superclasses. That is, the subclass should never provide ...