Explain the concept of inheritance in OOP?
Explain the concept of inheritance in OOP?
Inheritance is a fundamental concept in Object-Oriented Programming (OOP) that allows one class (the child or derived class) to inherit attributes and behaviors (methods) from another class (the parent or base class). This concept facilitates code reuse, promotes modularity, and establishes a natural hierarchy between classes.