接口
- 接口需要interface标记
- 通常情况下接口中的方法均为抽象方法,不写入具体内容,但是使用default 或 static 进行修饰可以实现具体方法
public interface IntefercaeDemo {
//可以实现具体方法
default void showDefault(){
System.out.println("this is showDefault method");
}
static void showStatic(){
System.out.println("this is showStatic method");
}
//没有实现的抽象方法
void sayHi();
}