摘要: 多态 方法多态 一个方法可以根据发送对象的不同而采用多种不同的行为方式 class Person{ public void run(){ Sytsem.out.println("person"); } } class Student extends Person{ public void run() 阅读全文
posted @ 2021-10-09 18:42 大帅爱编程 阅读(42) 评论(0) 推荐(0)
摘要: super 调用父类属性 class Person{ String name="gcs"; } class Student extends Person{ String name="lh"; public void test(String name){ System.out.println(name 阅读全文
posted @ 2021-10-09 10:54 大帅爱编程 阅读(49) 评论(0) 推荐(0)