default methodからprivate methodを利用する
interface A {
private void privateMethod() {
System.out.println("aaaaprivate");
}
default void method() {
System.out.println("aaaaA");
privateMethod();
}
}
class C implements A{
public void method() {
A.super.method();
}
}
public class Outer {
public static void main(String[] args) {
new C().method();
}
}
aaaaA
aaaaprivate