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

Discussion Forum : Object Oriented Programming Using C++ - Section 2 (Q.No. 34)
34.
If a derived class uses the public access specifier, then _____
public base class members remain public in the derived class
protected base class members become public in the derived class
both (a) and (b)
neither (a) nor (b)
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
3 comments Page 1 of 1.

Ayesha.. said:   3 years ago
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.

Rashi Jain said:   5 years ago
I too agree C is the correct option.

Vijaya said:   7 years ago
I think option C is the correct answer.

Post your comments here:

Your comments will be displayed after verification.