Access specifier
We can inherit the two classes by using three access specifiers. access specifiers is also known as visibility mode. when a class is derived from an existing class, all the members of base class is automatically inherited in the derived class. but we can restrict access to data members of base class in derived class by using the access specifiers. the three access specifiers is:
1.Public access specifier.
2.Private access specifier.
3.Protected access specifier.