day09--继承中成员方法的访问特点

This commit is contained in:
xx
2026-09-23 11:10:17 +08:00
parent b121cf4b73
commit e2b378cc29
3 changed files with 33 additions and 0 deletions
@@ -0,0 +1,12 @@
package com.inmind.extends_method03;
/*
继承中成员方法的访问特点:在继承中访问成员方法时,new的是谁,就优先使用谁的成员方法,如果没有则向上找
*/
public class Demo04 {
public static void main(String[] args) {
Zi zi = new Zi();
zi.methodFu();
zi.methodZi();
zi.method();
}
}