Public, Private, and Protected Inheritance

来源:互联网 发布:用友软件创始人 编辑:程序博客网 时间:2024/05/16 14:49

 

In public inheritance , the members of the base retain their access levels: The public members of the base are public members of the derived and the protected members of the base areprotected in the derived.

In protected inheritance , the public and protected members of the base class are protectedmembers in the derived clas

s.

In private inheritance , all the members of the base class are private in the derived class.