day10--接口的静态方法的定义和使用
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.inmind.interface_static03;
|
||||
/*
|
||||
定义静态方法格式
|
||||
public static 返回值类型 方法名(参数列表){
|
||||
方法体
|
||||
};
|
||||
|
||||
*/
|
||||
public interface MyInterface {
|
||||
//接口中静态方法
|
||||
public static void method(){
|
||||
System.out.println("接口MyInterface的静态方法method");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user