【继承】
<1>Java只支持单继承,不支持多继承。
<2>继承父类的私有成员变量,只有所有权,没有使用权。
【继承中的构造方法】
![](https://img-blog.csdnimg.cn/2022010612223916745.png)
程序:
![](https://img-blog.csdnimg.cn/2022010612223988070.png)
运行结果: A()
B()
B:f()
【访问控制】
![](https://img-blog.csdnimg.cn/2022010612223979528.png)
注:default又被称为包权限。
【继承】
转载于:https://www.cnblogs.com/yedushusheng/p/4354711.html