day10--接口和实现类的多态

This commit is contained in:
xx
2026-10-09 10:45:51 +08:00
parent 28fad57350
commit 645b5b5ab2
3 changed files with 40 additions and 0 deletions
@@ -0,0 +1,12 @@
package com.inmind.interface_poly10;
public class MyInterfaceImpl implements MyInterface{
@Override//标记当前是重写的方法
public void method() {
System.out.println("实现类重写了抽象方法");
}
public void show(){
System.out.println("实现类独有的方法");
}
}