Reputation: 714
I have a question in object-oriented programming
how is the inheritance weakens the Encapsulation ?
Please I want to understand this point
Upvotes: 0
Views: 293
Reputation: 704
You can find an answer in How inheritance weakens encapsulation chapter of "The Object-Oriented Thought Process" by Matt Weisfeld.
The problem is that if you inherit an implementation from a superclass and then change that implementation, the change from the superclass ripples through the class hierarchy. The rippling effect potentially affects all the subclasses.
Upvotes: 1