实验类:
📎A.javahttps://www.yuque.com/attachments/yuque/0/2023/java/21609500/1699858993581-1df32da6-8360-4a98-aa1b-d9a59d3b2d76.java
📎B.javahttps://www.yuque.com/attachments/yuque/0/2023/java/21609500/1699858998289-d9e31046-7b32-4f4c-b747-fd6e77c584bf.java
📎Clinent.javahttps://www.yuque.com/attachments/yuque/0/2023/java/21609500/1699859004458-e7c5d324-46ab-4bb4-bc99-835a81ca4880.java
1:存在子父类关系时。创建子类前会默认的(隐示的)调用父类无参构造
2:当父类只存在一个有参构造时,子类必须显示的调用此有参构造!!!不调用就报错
3:当父类只存在有参构造时,子类必须显示的调用此有参构造