Computer Science - Object Oriented Programming Using C++ - Discussion

34. 

If a derived class uses the public access specifier, then _____

[A]. public base class members remain public in the derived class
[B]. protected base class members become public in the derived class
[C]. both (a) and (b)
[D]. neither (a) nor (b)

Answer: Option A

Explanation:

No answer description available for this question.

Vijaya said: (Apr 28, 2016)  
I think option C is the correct answer.

Rashi Jain said: (Aug 8, 2017)  
I too agree C is the correct option.

Ayesha.. said: (Jun 15, 2020)  
Public inheritance

When a class uses public member access specifier to derive from a base, all public members of the base class are accessible as public members of the derived class and all protected members of the base class are accessible as protected members of the derived class (private members of the base are never accessible unless friended).

public base class members remain public in the derived class.
protected base class members become protected in the derived class.

Answer is: A.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.