摘要: super注意点 super调用父类的构造方法,必须在构造方法的第一个 super必须只能出现在子类的方法或者构造方法中 super和this 不能同时调用构造方法 this 代表的对象不同: this :本身调用者这个对象 super:代表父类对象的应用 前提 this:没有继承也可以使用 sup 阅读全文
posted @ 2024-01-17 16:52 fightownself 阅读(2) 评论(0) 推荐(0) 编辑
摘要: super注意点 super调用父类的构造方法,必须在构造方法的第一个 super必须只能出现在子类的方法或者构造方法中 super和this 不能同时调用构造方法 this 代表的对象不同: this :本身调用者这个对象 super:代表父类对象的应用 前提 this:没有继承也可以使用 sup 阅读全文
posted @ 2024-01-17 11:58 fightownself 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 继承 //java中所有的类,都默认继承直接或者间接继承object//Person :人 父类//java中只有单继承没有多继承public class Person { private int money = 10_0000_0000;​ public int getMoney() { retu 阅读全文
posted @ 2024-01-17 10:35 fightownself 阅读(2) 评论(0) 推荐(0) 编辑