JAVA学习 Interface

来源:互联网 发布:何多苓 知乎 编辑:程序博客网 时间:2024/06/07 10:23

1. 声明interface时,interface中的声明默认为Public,因此在生命时可以忽略public。

2. An interface can contain constant declarations. All constant values defined in an interface are implicitly publicstatic, and final. Once again, you can omit these modifiers. 一个接口能够含有常量声明,在接口中声明的所有常量默认是公共、静态和最终的。因此可以忽略这些修饰符。

3.Users who have classes that implement interfaces enhanced with newdefault or static methods do not have to modify or recompile them to accommodate the additional methods. 使用default 和 static 扩展接口方法时,已经在类中引用的此接口不需要修改或者重新编译去引用附加的接口方法。

0 0
原创粉丝点击