正在加载图片...
Three ways to inherent Using class header syntax(语法) to specify class B: public A //public Class b inherent all public and protected members of A class B: public A, private C Class b inherent the public and protected members of A but all the public and protected members of C become the private members of B. class B: protected A All public and protected member of a become the protected member of B NOTE: in all model of inheritance, the private members of a remain private to a and are not accessible from members of b 山东大学计算机科学与技术学院数据结构第5章堆栈 7山东大学计算机科学与技术学院 数据结构 第5章 堆栈 Three ways to inherent ◼ Using class header syntax (语法) to specify class B: public A //public ◼ Class B inherent all public and protected members of A class B: public A, private C ◼ Class B inherent the public and protected members of A, but all the public and protected members of C become the private members of B. class B: protected A ◼ All public and protected member of A become the protected member of B. ◼ NOTE: in all model of inheritance, the private members of A remain private to A and are not accessible from members of B. 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有