There are three way to extend in c++,private,public and protected,If the method's permission is private,whatever the method of extend,the member is we can't use.protected like private in some aspects.The member in the class is
not available.But the class extends it the method in later class can use the member.This is the difference between private and protected.The constructor in the father class can't be extends .So we should write the constructor to construct the class .we can
write the constructor by the constructor in the father class.Virtual method in the class can help us avoid the some extends from the father class .Object in the class usually be named as son object . The assignment we only can't make the son class equal father
class . But we can make the father class equal son class.
c++ 中的多重继承和其权限问题
最新推荐文章于 2022-03-03 17:27:23 发布