day10--接口的静态方法的定义和使用

This commit is contained in:
xx
2026-10-08 13:44:23 +08:00
parent 4086ee1dd5
commit cfccb1d055
3 changed files with 43 additions and 0 deletions
@@ -0,0 +1,14 @@
package com.inmind.interface_static03;
/*
定义静态方法格式
public static 返回值类型 方法名(参数列表){
方法体
};
*/
public interface MyInterface {
//接口中静态方法
public static void method(){
System.out.println("接口MyInterface的静态方法method");
}
}