Java 2 Primer Plus

   

Java™ 2 Primer Plus

By Steven Haines, Steve Potts

Table of Contents
Chapter 7.  Inheritance

The following is a list of guidelines to keep in mind when designing your inheritance relationships.

  • Always make a subclass capable of doing everything a super class can do

  • Ensure that a subclass holds all information that the super class holds

  • Add attributes and behavior to the subclass to define behavior that is more specialized than what is found in the super class

  • Move common characteristics to the super classes

  • Allow different subclasses of the same super class to do the same thing, but differently


       
    Top
     

    Категории