what are the different types of access specifiers in C++ ?

From Classes and Methods chapter in PU/ Object Oriented Programming in C++

Asked on 1 Mar, 2020

Like 0 Dislike 953 Views

Add a comment

2 Answers

Anonymous on 4 Mar, 2020 Like 1 Dislike

Public - The members declared as Public are accessible from outside the Class through an object of the class.

Protected - The members declared as Protected are accessible from outside the class BUT only in a class derived from it.

Private - These members are only accessible from within the class. No outside Access is allowed.

Add a comment

Anonymous on 1 Mar, 2020 Like 0 Dislike

They are:

  1. Public
  2. Private
  3. Protected
Add a comment


Add your answer