摘要: I was learning through interfaces when I noticed that you can now define static and default methods in an interface. public interface interfacesample2 阅读全文
posted @ 2019-09-11 11:28 那些年的代码 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 以下情况可以通过编译 而以下情况则不可以 这里会提示错误 static method may be invoked on containing interface class only. 这是因为 在Java 8中,在接口中添加静态方法带来了一个限制 :这些方法不能由实现它的类继承。 这样做是有道理 阅读全文
posted @ 2019-09-11 11:28 那些年的代码 阅读(1610) 评论(0) 推荐(0) 编辑