Through a day of learning, do a simple summary of the interface.
interface, the interface mentioned here is actually a specification and can be understood as a guideline, a basic requirement. First, an interface is a special kind of abstract class that contains only basic attribute parameters, abstract methods, inner classes, and enumeration classes. Does not include a specific implementation process. It requires other classes that want to use the interface, and describes the methods within the interface in terms of their actual situation.
In the interface, the defined property parameters are default to public static final type, the method defaults to the public abstract type, and the inner class and enum class default to the public static type.
At the same time, the use of the interface has the following basic requirements:
1. The class implements the interface through implements, and the class is an abstract type.
2. The attribute values defined in the interface cannot be modified.
3, the interface can inherit the interface.
4, a class can inherit a class at the same time, implement multiple interfaces, but extends must be in front.
5, can not be new interface object, but you can define an interface reference type of variable, and point it to the implementation of the interface object, to achieve polymorphic purposes.
The above is a brief introduction of the interface, then the interface-oriented programming is summarized.
Java Learning-----Interface