19.3 Inheritance
In addition to the structural merging of data and the methods working on it into a single unit, the concept of object-oriented programming aims to improve the reusability of program code. This means that a program can be adapted with little effort to problems like the one for which the program was originally developed.
In concrete terms, this means that new classes can be derived from existing classes in order to extend them with additional functionality. The derived class inherits all the capabilities from its base class, so initially it’s a copy of that class. In this context, we say that the base class passes on its capabilities to a child class, which in turn inherits them. After this inheritance step, you can adapt the ...
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