Computer Science, asked by rvpriya03, 4 months ago

Which of the following are available only in the class hierarchy chain?
1 point
Public data members
Private data members
Protected data members
Member functions​

Answers

Answered by XxITZVAYUxX
1

\huge\color{aqua}\implies\huge \bold \red{ Answer}

  • Public data members
Answered by mahinderjeetkaur878
0

2. Private data members

The access level of these data members and member functions can be defined using access specifiers: public, private, and protected.

Public data members: Public data members can be accessed from anywhere in the program, including outside the class hierarchy chain. They are not limited to the class hierarchy chain.

Private data members: Private data members can only be accessed within the class where they are defined. They are not accessible from outside the class, including the class hierarchy chain.

Protected data members: Protected data members can be accessed within the class where they are defined and within any derived classes. They are not accessible from outside the class hierarchy chain.

Member functions: Member functions can be accessed from anywhere in the program, including outside the class hierarchy chain if they are public. Private member functions can only be accessed within the class where they are defined, while protected member functions can be accessed within the class hierarchy chain.

In summary, only private data members are limited to the class hierarchy chain, while public data members and member functions can be accessed from anywhere in the program. Protected data members can be accessed within the class hierarchy chain but not outside of it.

The question you might be looking for: -

Which of the following are available only in the class hierarchy chain?

1. Public data members

2. Private data members

3. Protected data members

4. Member functions

To know more: -

https://brainly.in/question/35746452?referrer=searchResults

https://brainly.in/question/25901722?referrer=searchResults

#SPJ3

Similar questions