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: 79

Filed under:
|
|
|

Which one of the following is NOT a pitfall of inheritance?

  1. Base-derive classes should be totally separate and do not have an is-a relationship.

  2. Base-derive classes should have been aggregate classes instead.

  3. Inheritance may be inverted, example: Truck<-Vehicle should be Vehicle<-Truck.

  4. Incompatible class hierarchies may be connected because of multiple inheritance. Aggregation should have been used instead.

  5. 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

Related posts about java

Related posts about c++