What is the use of protected members? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the use of protected members?

28th Dec 2016, 6:06 AM
kiran c
kiran c - avatar
2 Answers
+ 3
Protected members are only accessible to the base class and the derived class no other class can access it. for example, a father's bike can only be accessed by his son or daughter. so bike is a protected member.
28th Dec 2016, 6:22 AM
Ravi Kumar
Ravi Kumar - avatar
0
an example so clearly about real world Ravi Kumar
28th Dec 2016, 3:59 PM
nguyenphuoc
nguyenphuoc - avatar