C++ Inheritance Access

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
  1. public – object of derived class can be treated as object of base class (not vice-versa)
  2. protected – more restrictive than public, but allows derived classes to know details of parents
  3. 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