EY interview question

In object-oriented programming (OOP), one key concept is **inheritance**. Inheritance allows a class (called a child or subclass) to inherit attributes and methods from another class (called a parent or superclass). This promotes code reusability and establishes a hierarchical relationship between classes. For example, a `Dog` class can inherit from an `Animal` class, gaining access to its methods and properties while also introducing specific features unique to dogs.