SUMMARY
-
When a new class is derived in terms of an existing class, the new class is termed as derived class, whereas the existing class is termed as base class.
-
The syntax of derived class definition is as follows:
class<derived_class_name> : <access modifier> <base class_name>
-
When a class is derived from a base class, it automatically acquires variables and methods from base class. This phenomenon is called inheritance.
-
When we derive a new class from a given base class, we have to specify the method of derivation. Here, keywords public, private and protected are used. Therefore, Turbo C++ manual calls these terms as access modifiers. (It is important to note that these terms are also called access specifiers, when they are present inside ...
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