0

I have a question in object-oriented programming

how is the inheritance weakens the Encapsulation ?

Please I want to understand this point

Ahmed Galal
  • 694
  • 7
  • 21

1 Answers1

1

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.

Basilevs
  • 22,440
  • 15
  • 57
  • 102
Gabriel M
  • 710
  • 4
  • 7
  • [Provide context for links](http://stackoverflow.com/help/how-to-answer) Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – Basilevs May 26 '14 at 11:22