摘要: 接口的默认方法 Java 8允许我们给接口添加一个非抽象的方法实现,只需要使用 default关键字即可,这个特征又叫做扩展方法,示例如下: interface Formula { double calculate(int a); default double sqrt(int a) { retur 阅读全文
posted @ 2021-03-30 17:33 低调人生 阅读(98) 评论(0) 推荐(0) 编辑