I. abstract classes
1. abstract classes do not have to have abstract attributes and abstract methods. abstract classes must be declared after the abstract methods are declared;
2. The subclass must be an abstract method of the override base class;
2. API www.2cto.com
1. Only methods can be included;
2. The interface cannot contain constants, fields, constructors, destructor, or static members;
3. All members in the interface are set to public by default;
4. Subclass must implement all the members in the interface;
5. A class can implement multiple interfaces separated by commas;
6. An interface can have multiple interfaces. All members of the parent interface must be implemented;
Iii. Differences between abstract classes and interfaces
1. abstract classes are incomplete classes and need to be further refined; interfaces are just a specification or provision of behavior;
2. The method of the abstract class is virtual by default, and the method in the interface is non-virtual by default. It can also be declared as virtual;
By: dxh_0829