The private members of the base class are visible in derived class but are not accessible directly.
The private members of the base class are visible in derived class but are not accessible directly. Correct Answer True
Consider that a variable is private in base class and the derived class uses public inheritance to inherit that class. Now if we also have a global variable of same name as that of base class private variable, neither the global variable nor the base class private variable will be accessible from derived class. This is because we can’t have 2 variables with same name in same local scope. Hence the private members are accessible but not directly.
মোঃ আরিফুল ইসলাম
Feb 20, 2025