logo

Programming - Tutorial 7

   

Added on  2022-10-10

6 Pages1020 Words171 Views
Running head: PROGRAMMING
PROGRAMMING
Name of the Student:
Name of the University:
Author Note:

PROGRAMMING1
Table of Contents

PROGRAMMING2
Tutorial 7
When is the protected access used in C++? Who can access protected members of class?
The protected keyword specifically provisions with the access to all of the members
existing within the class down the list of members until the next access specifier or might as
well be the reach towards the end of the definition belonging to the class. All of the members
belonging to the class when declared as protected can be utilized by the following mentioned
below. These are,
Member functions belonging to the class that had been originally declared by all of
these members.
Friends of this particular class that had been originally declared by all of these
members.
Classes that have been derived from the public or the protected access from the
originally existing class that have been declared by this specific group of members.
The direct classes that have been derived privately also having the inclusion of the
private access to that of the protected members.
Protected members of the class are very much considered to be similar to that of the
private members as a reason of the fact that they cannot be accessed from the outside of the
class. However, they can be very much accessed by the classes that have been derived or
might as well be accessed from the child classes to be specific.
When deriving a class from a protected class, what is the level of access of the
public/protected members of the base class in the derived class?
The private members existing within the class carry the provision to be inherited but
however cannot be accessed directly from the classes that have been derived. They can be

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Object Oriented Programming with C#
|6
|690
|365

Blog on Data Encapsulation
|3
|555
|285

Assignment On Object Oriented Programming With Java
|4
|570
|40

Object Oriented Programming: Inheritance, Encapsulation, Polymorphism
|11
|1451
|340

Java Programming
|4
|710
|381

Assignment on Application Development
|28
|9269
|140