基类訪问权限 | 类继承方式 | 子类訪问权限 | |
public | public | ||
protected | public | protected | |
private | No Access | ||
public | protected | ||
protected | protected | protected | |
private | No Access | ||
public | private | ||
protected | private | private | |
private | No Access | ||
基类訪问权限 | 类继承方式 | 子类訪问 | 子类对象訪问 |
public | ok | ok | |
protected | public | ok | no |
private | no | no | |
public | ok | ok | |
protected | protected | ok | no |
private | no | no | |
public | ok | no | |
protected | private | ok | no |
private | no | no |