Inheritance
First of all, we need to speak about what inheritance is. Inheritance is one of the features of the OOP paradigm. According to the paradigm, inheritance organizes and supports polymorphism and encapsulation, facilitating the definition and creation of a specialized object based on a more general one.
As an example, I used one of the most commonly used examples of a class named ZCL_CAR. All vehicles have wheels, an engine, and a fuel tank. But, if we speak about a more specific vehicle, for example, a truck, we also want to know how much of a load that truck can carry. So, to create a class for the truck, we can call it ZCL_TRUCK, and we can inherit the ZCL_CAR class, as we have some parameters that the truck also has. We also ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access