接口在1.8版本增加的静态和默认的方法

接口支持静态方法 与 默认方法
    static
    default
    接口中的方法 可以用 abstract / default / static 修饰
    修饰符不能混合使用
    被abstract修饰的方法 子类必须重写
    被default/static修饰的方法 子类可以选择性重写
    重写default修饰的方法时 权限修饰符必须是public

  

posted on 2018-08-08 21:37  花伶  阅读(115)  评论(0编辑  收藏  举报

导航