Which one of the following is NOT a pitfall of inheritance?
Posted
by
Difficult PEOPLE
on Stack Overflow
See other posts from Stack Overflow
or by Difficult PEOPLE
Published on 2012-09-06T03:16:42Z
Indexed on
2012/09/06
3:38 UTC
Read the original article
Hit count: 77
Which one of the following is NOT a pitfall of inheritance?
Base-derive classes should be totally separate and do not have an is-a relationship.
Base-derive classes should have been aggregate classes instead.
Inheritance may be inverted, example: Truck<-Vehicle should be Vehicle<-Truck.
Incompatible class hierarchies may be connected because of multiple inheritance. Aggregation should have been used instead.
Functionality is transferred from a base class to a derived one.
In my opinion, NOT a pitfall of inheritance meas can use inheritance.
1 seems do without inheritance
2 aggregate substitute Base-derive I don't know
So, I think 5 is the answer.
© Stack Overflow or respective owner