In Programming in Scala, page 239, the first paragraph says:
Composition and inheritance are two ways to define a new class in terms of another existing class. If what you’re after is primarily code reuse, you should in general prefer composition to inheritance. Only inheritance suffers from the fragile base class problem, in which you can inadvertently break subclasses by changing a superclass.
To me it is unclear. Can anyone show an example of such a situation, preferably with some code?