1.

If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the user will not be able to call _________ from the object of class B.(a) Any function of class A(b) The add() function of class A(c) Any member of class A(d) Private, protected and public members of class AThe question was asked at a job interview.Question is from Access Specifiers topic in section Access Specifiers of Object Oriented Programming

Answer»

The CORRECT CHOICE is (d) Private, protected and PUBLIC members of class A

The explanation is: Class B OBJECT will not be able to call any of the private, protected and public members of class A. It is not only about the function ADD(), but all the members of class A will become private members of class B.



Discussion

No Comment Found

Related InterviewSolutions