Self-Review Exercises

  1. 11.1 Fill in the blanks in each of the following statements:

    1.            is a form of software reusability in which new classes acquire the members of existing classes and enhance those classes with new capabilities.

    2. A base class’s            members can be accessed only in the base-class declaration and in derived-class declarations.

    3. In a(n)            relationship, an object of a derived class also can be treated as an object of its base class.

    4. In a(n)            relationship, a class object has references to objects of other classes as members.

    5. In single inheritance, a base class exists in a(n)            relationship with its derived classes.

    6. A base class’s            members are accessible anywhere that the app has a reference to an object of that base class or to an object of any of its derived classes.

    7. When an object of a derived class is instantiated, a base class            is called implicitly or explicitly.

    8. Derived-class constructors can call base class constructors via the            keyword.

  2. 11.2 State whether each of the following is true or false. If a statement is false, explain why.

    1. Base-class constructors are not inherited by derived classes.

    2. A has-a relationship is implemented via inheritance.

    3. A Car class has is-a relationships with the SteeringWheel and Brakes classes.

    4. Inheritance encourages the reuse of proven high-quality software.

    5. When a derived class redefines a base-class method by using the same signature and return type, the derived class is said to overload that base-class method.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset