C++ Inheritance Access
C++ Inheritance Access
In this tutorial, You will learn about C++ Inheritance Access, There are three access specifiers available in C++ are as follow:
Access Specifiers
-
public – object of derived class can be treated as object of base class (not vice-versa)
-
protected – more restrictive than public, but allows derived classes to know details of parents
-
private – prevents objects of derived class from being treated as objects of base class.
Example: Program to shows that Single Inheritance in C++ Inheritance Access is as follows:
Output