in Others edited by
1,043 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
in Others edited by
1.0k views

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