What are the drawbacks of inheritance?
Drawbacks of inheritance : * Difficulty of understanding complex hierarchy. * Makes writing a compiler harder, e.g. requires more dynamic type checking since type of an object can change during runtime. * Adversely affects execution speed, program size, program complexity, and incurs method passing overhead. * Inheritance forces a set of methods and fields on a class. You may not want some of these, and it is not necessary that all of these are required. There is no concept of partial inheritance. * Interface stability of base classes sometimes require even more complexity.