From the k&B Practice Exams.
Answer (for Objective 5.5):
B, E, and F are correct statements about the code.
A and C are incorrect because the MyApp class “uses” the Employee class, but MyApp isn’t
in Employee’s class hierarchy, and MyApp doesn’t “have” an Employee as part of its state.
D is similarly incorrect because MyApp doesn’t “have” a Mungeable as part of its state.
When answering the above question i selected the option that says MyApp has-a Employee.
The book says that this is wrong because Employee and MyApp are not on the same inheritance tree. Is this correct?
I was not aware that the classes are supposed to be on the same inheritance tree for a has-a relationship.