An interface is a series of method declarations and a collection of method characteristics. An interface only has method characteristics but no method implementation. Therefore, these methods can be implemented by different classes in different places, and these implementations can Have different behaviors (functions).
java interface
(Recommended learning: java entry program)
Java interface is a The declaration of a series of methods is a collection of method characteristics. An interface only has method characteristics but no method implementation. Therefore, these methods can be implemented by different classes in different places, and these implementations can have different behaviors (functions).
Two meanings: first, Java interface, a structure that exists in the Java language, has specific syntax and structure; second, a set of characteristics of methods possessed by a class, which is a logical abstraction. The former is called "Java interface" and the latter is called "interface".
(Video tutorial recommendation: java video tutorial)
Define the format of the interface
1 2 3 4 5 6 7 |
|
Implement the format of the interface
1 2 3 4 5 6 |
|
The above is the detailed content of What is the interface. For more information, please follow other related articles on the PHP Chinese website!