May 2012
Intermediate to advanced
679 pages
16h 56m
English
Inheritance comes in many types. To begin with, let us start with what is termed as single inheritance. It can be shown in Figure 9.2.
Here, 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> { //declarations }
Figure 9.2 Derived and base class
It contains:
Read now
Unlock full access