JAVA learning ----- interface, java ----- Interface
Make a simple summary of the interface through one day's study.
Interface, the interface mentioned here is actually a standard, can also be understood as a standard, basic requirements. First, an interface is a special abstract class that only contains basic attribute parameters, abstract methods, internal classes, and enumeration classes. It does not contain specific implementation processes. It requires other classes that want to use this interface, and provides detailed descriptions of the methods in the interface according to their actual conditions.
In the interface, all defined attribute parameters are of the public static final type by default, methods are of the public abstract type by default, and internal classes and enumeration classes are of the public static type by default.
At the same time, the interface has the following basic requirements:
1. The class implements the interface through implements, and the class is of the abstract type.
2. The property value defined in the interface cannot be modified.
3. interfaces can inherit interfaces.
4. A class can inherit one class and implement multiple interfaces at the same time, but extends must be in front.
5. A new interface object is not allowed, but a variable of the interface reference type can be defined and pointed to the object implementing the interface to achieve polymorphism.
The above is a brief introduction to the interface, and the interface-oriented programming will be summarized later.