But class inheritance has some disadvantages, too. First, you can't change the implementations inherited from parent classes at run-time, because inheritance is defined
at compile-time. Second, and generally worse, parent classes often define at least part of their subclasses' physical representation.Because inheritance exposes a subclass to details of its parent's implementation, it's often said that "inheritance breaks encapsulation"[ Sny86] .
The implementation of a subclass becomes so bound up with the implementation of its parent class that any change in the parent's implementation will
force the subclass to change.