1.

A derived class object can access the public members of the base class.(a) True(b) FalseI got this question in final exam.I'd like to ask this question from Public Member Functions topic in division Member Functions & its Types of Object Oriented Programming

Answer»

Correct choice is (b) False

To explain I would say: The public MEMBERS of the base class can be accessed from the DERIVED class object only if public inheritance is used. If PROTECTED or PRIVATE inheritance is used then those members become public/protected in derived class and hence won’t be able to be CALLED from object of the derived class.



Discussion

No Comment Found

Related InterviewSolutions