How to access the inherited member variables

Parent-child class member variables of different names: a normal visit, had no effect

Parent-child class member variables with the same name: comply with the principle of proximity

Priority to find a local position, if there is a local position of the variable, the direct use

If not, go to this location to find a class member, if used directly

If this position is not a member of the class, then go find a member location of the parent class, if there is direct use, if not an error

Guess you like

Origin www.cnblogs.com/libinhong/p/10990268.html