Every modern object-oriented language supports inheritance. Inheritance is a powerful feature that can help you to build even more powerful applications.
In this section, we take a close look at the fundamental concepts of inheritance, and you learn where to use inheritance efficiently.
Classes provide certain methods and have a set of properties. When it comes to inheritance, the features of a class are inherited by child classes, which means that a child class will have all features of its parent class plus some proprietary information. In addition, a class can redefine a feature of the parent class. To make this concept clearer, let's look at a simple example: Imagine a class that can be used to store geometric objects. ...