When you create an interface, you're defining a contract for what a class can do,
without saying anything about how the class will do it. An interface is a contract.
how the methods and variables defined in the interface are declared. These rules are strict:
■ All interface methods are implicitly public and abstract. In other words,
you do not need to actually type the public or abstract modifiers in the
method declaration, but the method is still always public and abstract.
■ All variables defined in an interface must be public, static, and final—
in other words, interfaces can declare only constants, not instance variables.
■ Interface methods must not be static.
■ Because interface methods are abstract, they cannot be marked final,
strictfp, or native.
■ An interface can extend one or more other interfaces.
■ An interface cannot extend anything but another interface.
■ An interface cannot implement another interface or class.
■ An interface must be declared with the keyword interface.
■ Interface types can be used polymorphically .
Declaring Interface Constants
You're allowed to put constants in an interface. By doing so, you guarantee that any class implementing the interface will have access to the same constant.
Because interface constants are defined in an interface,they don't have to be declared as public, static, or final. They must be public, static, and final, but you don't have to actually declare them that way.