edited by
1,040 views
0 votes
0 votes

Let $A$ be the base class in $\text{C++}$ and $B$ be the derived class from $A$ with protected inheritance. Which of the following statement is false for class $B$?

  1. Member function of class $B$ can access protected data of class $A$
  2. Member function of class $B$ can access public data of class $A$
  3. Member function of class $B$ cannot access private data of class $A$
  4. Object of derived class $B$ can access public base class data
edited by

1 Answer

0 votes
0 votes

Answer D,

Function of Derived class can access protected or Public base class data but Object of Derived class cannot access any member of Base class directly.

So it cannot access any members directly whether it is public protected or private.

Related questions

1 votes
1 votes
2 answers
1
4 votes
4 votes
6 answers
3
soujanyareddy13 asked May 12, 2021
1,869 views
The Boolean expression $AB+A \overline{B}+\overline{A}C+AC$ is unaffected by the value of the Boolean variable _________.$A$$B$$C$$A, B$ and $C$