本文共 802 字,大约阅读时间需要 2 分钟。
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.转载地址:http://lftmi.baihongyu.com/