接口
是程序的功能扩展
interface
implements 实现
可以被类多实现
只有在接口与接口间存在多继承
接口的成员(字段 + 方法)默认都是 public 的,并且不允许定义为 private 或者 protected
public interface InterfaceExample {
void func1();
default void func2(){
System.out.println("func2");
}
int x = 123;
public int z = 0; // Modifier 'public' is redundant for interface fields
}