|
If it is private inheritance, the accessibility of name becomes private, and public inheritance is
//name's accessibility remains unchanged (but if name is private in the base class, it is not accessible).
I ran the protected attribute of the parent class. The child class inherits privately, and the name in the parent class (still protected) can still be accessed in the child class.
At this time, the name parent class is still protected to the outside, and the subclass inherits it as private. Where is it reflected? |
|