无法使用 super 调用父接口的默认方法

问题描述

interface WithDeFinitionsInter {
    default void definedMeth() {
        System.out.println("inside interface");
    }
}
class WithDeFinitionsImpl implements WithDeFinitionsInter {
    public void definedMeth() {
        super.definedMeth(); // compilation error here
        System.out.println("inside class");
    }
}
public class QuizDef {
    public static void main(String par[]) {
        WithDeFinitionsInter withDef = new WithDeFinitionsImpl();
        withDef.definedMeth();
    }
}

谁能解释一下为什么我不能使用 super 关键字调用父接口的方法

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)