Chapter 5


  1. Inheritance is a programming technique that enables a class to inherit some or all attributes and behaviors of another class.

  2. Simple inheritance is a type of inheritance in which a class inherits from just one class.

  3. Level inheritance is a type of inheritance in which two or more levels of inheritance exist. Each level consists of a parent-child relationship whereby the child of the middle level is also the parent of the lower level. The last child in level inheritance inherits directly and indirectly from other levels.

  4. Multiple inheritance is a type of inheritance in which a child inherits from multiple parents, but no relationship exists among those parents.

  5. The is a test is given to determine if a child is a parent. For example, is a graduate student a student? If so, the child (graduate student) can inherit from the parent (student). If not, the child cannot inherit from the parent.

  6. Multiple inheritance should be used whenever a child needs to inherit attributes and behaviors from parents that are not related to each other.

  7. Level inheritance should be used whenever a child needs to inherit attributes and behaviors from parents that are related to each other.

  8. There is no maximum number of levels in level inheritance. However, you should use no more than three levels; otherwise , you run the risk that the levels will become unmanageable.

  9. A child can inherit public and protected members of a parent class.

  10. Base class is the term used in C++ to refer to a parent class. Derived class is the C++ term for a child class. A super class is Javas parent class, and Javas child class is called a subclass.




OOP Demystified
OOP Demystified
ISBN: 0072253630
EAN: 2147483647
Year: 2006
Pages: 130

Similar book on Amazon

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