[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C++ Programming :: Objects and Classes - Discussion

Home > C++ Programming > Objects and Classes > MCQs Questions Discussion

8 / 41

Choose the correct option.

All the public members of a base class becomes protectedc member of the derived classThis happen in

AVirtual inheritance

Bprotected inheritance

Cprivate inheritance

Dpublic inheritance

Answer: Option (Login/Signup)

Show Explanation

There are 3 access specifiers in c++. Public, Private and Protected. 

Public members are accessible outside the class through an object of the class.

Protected members are also accessible outside the class but only from the class which derived it.All public members of a base class becomes protected members of the derived class.

Private members can not be accessed from outside the class.

In Private inheritance, all public and protected members of base class becomes private to the derived class and can be accessible.

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here