Inheritance –
Deriving/Creating a new class based
on the existing one is known as Inheritance. For implementing inheritance 3
things are required -
- Base Class
- Derived Class
- Access Specifier
For Example –
class car : public vehicle
In the code
given above, class is a keyword which is used to define a new class, car is the
derived class, public is an access specifier and vehicle is the base class.
No comments:
Post a Comment