The characteristics of the interface are: 1. The interface is modified with the interface keyword; 2. The interface cannot be instantiated; 3. The implementation class must implement all methods of the interface (except abstract classes); 4. The implementation class can Implement multiple interfaces; 5. The constants in the interface are all static constants
java interface features:
(recommended tutorial: Java entry program)
(1) The interface is modified with the interface keyword;
(2)The interface cannot be instantiated;
(3)The implementation class must All methods that implement interfaces (except abstract classes);
(4) Implementation classes can implement multiple interfaces (java multiple inheritance);
(5) Constants in interfaces are static constants ;
(Video tutorial recommendation: java video tutorial)
Code sample:
public interface Myinter{ public abstract void foo(); //其他方法 }
The above is the detailed content of What are the characteristics of the interface?. For more information, please follow other related articles on the PHP Chinese website!