Oops
Oops
ORIENTED
PROGRAMMING
ABHIJEET SINGH
WHAT IS OOPs
Complexity: Inheritance can make code more complex, especially when the
hierarchy becomes deep. Understanding the flow of data and method calls
across multiple levels of inheritance can be challenging for developers.
Flexibility: Inheritance can limit flexibility because a subclass is strictly
bound to the design and structure of its parent class.
Base Class Problem: Changes to the base (parent) class can inadvertently
affect all derived (child) classes. For example, adding or modifying a
method in the base class could override a subclass method or introduce new
behaviors that break the existing code.
Overhead: Deep inheritance hierarchies may introduce a
performance overhead, as method calls need to traverse through the
hierarchy. Additionally, large inheritance trees can increase
memory consumption.
TYPES OF INHERITANCE