If a base class is inherited in protected access mode then which among the following is true?

Ngoc Hue

New member
If a base class is inherited in protected access mode then which among the following is true?
A. Public and Protected members of base class becomes protected members of derived class
B. Only protected members become protected members of derived class
C. Private, Protected and Public all members of base, become private of derived class
D. Only private members of base, become private of derived class
 
Answer: a
Explanation: As the programming language rules apply, all the public and protected members of base class becomes protected members of derived class in protected access mode. It can’t be changed because it would hinder the security of data and may add vulnerability in the program.
 

Tìm kiếm

Back
Top