摘要: Account.java package exer; public class Account { private int id; private double balance; private double annualInterestRate; public Account(int id,dou 阅读全文
posted @ 2022-01-17 19:48 ice--cream 阅读(55) 评论(0) 推荐(0) 编辑
摘要: super理解为 父类的 super可以调用属性、方法、构造器 package exer; public class SuperTest { public static void main(String[] args) { Student s=new Student(); s.show(); s.e 阅读全文
posted @ 2022-01-17 13:54 ice--cream 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 重写:子类继承父类以后,可以对父类中同名同参数的方法,进行覆盖操作 子类重写的方法的方法名和形参列表与父亲被重写的方法的方法名和形参列表相同。 子类重写的方法的权限修饰符不小于父类被重写的方法的权限修饰符。 子类不能重写父类中声明为private权限的方法 父类被重写的方法的返回值类型是void,则 阅读全文
posted @ 2022-01-17 11:56 ice--cream 阅读(75) 评论(0) 推荐(0) 编辑