Explore BrainMass
Share

# Several questions about class inheritance

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Classes A, B, C and H are related through inheritance and have the fields shown in the class tree
diagram below. Class G is not related to any of the other classes

Please see attachment file for more details

https://brainmass.com/computer-science/trees/295930

#### Solution Preview

in the diagram indicate "derives from". That is, if class B has an
arrow to class A that means that class B derives from class A. With
that in mind we can answer each of the given questions:

i) A is a derived class of B and B is a derived class of C.

This is false. The arrows go from C to B and B to A, not the other
way around.

ii) C is a derived class of B and B is a derived class of A.

This is tue. The arrows are heading in the correct direction.

iii) A and B are both derived classes of C.

False. Instead C derives from B (and A).

iv) B and C are both derived from A.

True. B derives ...

#### Solution Summary

This solution provides detailed answers to explain several questions about class inheritance in an object oriented design.

\$2.19