Tuesday 9 October 2012

Inheritance


Inheritance –
            Deriving/Creating a new class based on the existing one is known as Inheritance. For implementing inheritance 3 things are required -
  1. Base Class
  2. Derived Class  
  3. 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