学习笔记-Java8新特性-第六节-接口中的默认方法与静态方法

# 接口中的默认方法与静态方法 ## 默认方法 * 在接口中可以使用default修饰方法,为方法提供默认实现 * public interface MyInterface { default void getName() { System.out.println("DEFAULT"); } } *
posted @ 2023-05-21 23:13  0Andl0  阅读(10)  评论(0编辑  收藏  举报