If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the

Giang Phạm

New member
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 A
 
Answer: d
Explanation: 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.
 

Tìm kiếm

Back
Top