What happens to private or protected inheritance? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

What happens to private or protected inheritance?

20th Mar 2016, 6:03 PM
andwan0
andwan0 - avatar
1 Réponse
+ 4
If the inheritance is protected, only Child, and its children, are aware that they inherit from Base. If the inheritance is private, no one other than Child is aware of the inheritance. So, basically: public -> base class's public members will be public (usually the default) protected -> base class's public members will be protected private -> base class's public members will be private
13th May 2016, 2:30 PM
James Flanders