We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It means that public data of base class are public in the derived as well, protected data of base class are private in the derived and private data of base class are not accessible to the derived.
We can have also protected and private inheritances for a better explanation give a look yup the following link: https://www.tutorialspoint.com/cplusplus/cpp_inheritance.html .
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangle Area
You are viewing a single comment's thread. Return to all comments →
It means that public data of base class are public in the derived as well, protected data of base class are private in the derived and private data of base class are not accessible to the derived. We can have also protected and private inheritances for a better explanation give a look yup the following link: https://www.tutorialspoint.com/cplusplus/cpp_inheritance.html .