- 5
- 0
- 约1.29万字
- 约 17页
- 2017-10-06 发布于河南
- 举报
派生说明(Derived description)
派生说明(Derived description)
When a subclass inherits from a parent class, all members of the parent class become members of the subclass, and access to the parent class members is determined by the inheritance qualifier used at inheritance time.
1. if the inheritance qualifier used when the subclass inherits from the parent class is public, then
(1) the public members of the parent class become public members of subclasses, allowing code other than classes to access those members;
(2) the private members of the parent class are still members of the private class of the parent class, and the members of the subclass are not allowed to access them;
(3) the protected member of the parent class becomes the protected member of the subclass, allowing only the subclass members to access;
2. if the inheritance qualifier used when the subclass inherits from the parent class is private, then
(1) the public member of the parent class becomes the private member of the subclass, allowing only the subclass members to access;
(2) the private members of the parent class are still members of the private class of the parent class, and the members of the subclass are not allowed to access them;
(3) the protected member of the parent class becomes the private member of the subclass, allowing only the subclass members to access;
3. if the inheritance qualifier used when the subclass inherits from the parent class is protected, then
(1) the public member of the parent class becomes the protected member of the subclass, allowing only the subclass members to access;
(2) the private members of the parent class are still members of the private class of the parent class, and the members of the subclass are not allowed to access them;
(3) the public member of the parent class becomes the protected member of the subclass, allowing only the subclass members to access;
As for the different members of the class (public, private and protected) access status not elaborate.
C++ access rights and derived
您可能关注的文档
- 推荐一本既能提高思想境界又能提高文学修养的书(Recommend a book that can both improve your mind and improve your literature).doc
- 推动共同发展 共建和谐亚洲(Promote common development and build a harmonious Asia).doc
- 推荐论文--论大学生行为习惯的研究与实训(Recommended papers on the study and training of College Students' behavior habits).doc
- 推销技巧(salesmanship).doc
- 描写风好词好句(Describe the wind, good words, good sentences).doc
- 提问的艺术80863(The art of asking questions 80863).doc
- 提升科技期刊国际显示度的途径与策略(Approaches and strategies for improving international display of scientific journals).doc
- 提升饭店竞争力的营销策略(Marketing strategy of promoting Hotel competitiveness).doc
- 提高您的染发技术(Improve your hair color techniques).doc
- 提高情商的47种方法(47 ways to improve EQ).doc
- 伟明环保-市场前景及投资研究报告-境内业务稳健运行,印尼市场贡献边际增量.pdf
- 桂东县法院系统招聘考试真题2025.pdf
- 贵州省黔南布依族2026年中考三模物理试题及答案.pdf
- 贵州省黔南州2026年中考语文二模试卷附答案.pdf
- 贵州省铜仁市2026年中考语文二模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套完整答案详解.docx
- 贵州省毕节市2026年中考语文一模试卷附答案.pdf
- 贵州省贵阳市南明区2026年中考语文一模试卷附答案.pdf
- 2026上半年安徽事业单位联考合肥市庐江县招聘36人备考题库及一套参考答案详解.docx
- 贵州省贵阳市白云区2026年中考二模物理试题附答案.pdf
最近下载
- 2024年浙江省中考英语真题卷(含答案与解析)_7429.pdf VIP
- 华东师大版八下历史第二单元第4课-“大跃进”和人民公社化运动PPT24张.ppt VIP
- 2012上海杨浦区高三英语二模试卷及答案.doc VIP
- FANUC数控车床的主轴控制设计.doc VIP
- 2022年ISGE指南:宫腔镜子宫肌瘤切除术(全文).docx VIP
- 2025年湖南省长沙市中考英语真题(附答案).pdf VIP
- 怎么参加展会才能获得客户.doc VIP
- 设计斜齿轮零件的机械加工工艺规程.doc VIP
- 安徽省经济潜在增长率的测算、分析与展望:基于多维度视角与实证研究.docx
- 基于大数据植入广告发展趋势研究.doc VIP
原创力文档

文档评论(0)