接口
静态方法
public interface JDK8Interface {
// static修饰符定义静态方法
static void staticMethod() {
System.out.println("JDK8Interface1接口中的静态方法");
}
}默认方法
public interface Comparable<T>{
default int compareTo(T other) {
return 0;
}
}解决默认方法冲突
Last updated