9.1 INTRODUCTION
Some experts consider that OOP is nothing but code reuse. One of the most important tool in code reuse is inheritance. If we have developed a class and we need a new class, which is almost similar to it but slightly better than that one (more instance variables and methods), principle of inheritance becomes handy. In non-OOP programming, we have to define completely the new structures and functions. In OOP, a new class can be derived from a old class. In that case, it automatically acquires all the variables and methods from the old class. This saves a lot of development time. The new class is considered as derived class, whereas the old class is termed as base class.
We are familiar to windows. First, window is a simple text ...
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