The Syntax and Terminologies
In this lesson, you will learn how to use inheritance and the terminologies related to it.
We'll cover the following...
We'll cover the following...
The Terminologies
Since we know that a new class is created based on an existing class in inheritance, we use the terminology below for the new class and the existing class:
- Base Class (Mother Class or Superclass): This class allows the re-use of its
non-privatemembers in another class. - Derived Class (Child Class or Subclass): This class is the one that inherits from the superclass.
A child class has all non-private characteristics of the mother class.
What Does a Child have?
An object of the child class can use:
- All members defined in the child class.
- All
non-privatemembers defined in the mother class.