在Thinking in Java中有这样的描述:
The interface keyword produces a completely abstract class, one that provides no implementation at all. It allows the creator to determine method names, argument lists, and return types, but no method bodies. An interface provides only a form, but no implementation.(接口是完全抽象的一个类,不提供任何实现)
接口中的字段默认就是并且必须是public static final的,不是你所说的实例字段. 字段只能是属于类变量,不可以是实例变量.
同样在Thinking in Java中有:
When you say something is static, it means that particular field or method is not tied to any particular object instance of that class.(接口中静态的属性或者方法均与具体的实例无关) |