Interface
1. The interface only provides the method specification, does not provide the method body;
2. The methods in the interface cannot be decorated with keywords;
3. Interfaces and variables cannot be in the interface;
4. The method in the interface must be fully implemented in the subclass;
5. The interface can achieve multiple inheritance;
Abstract class
1. Abstract classes can be inherited from interfaces;
2. Entity methods in abstract classes cannot be overridden in subclasses and can only be referenced;
3. Abstract methods in abstract classes may not have method bodies, abstract methods in abstract classes must be rewritten in subclasses;
4. Virtual methods in abstract classes can be selectively overridden in subclasses;
Virtual method
1. Can be overridden in sub-class selectively;
2. Do not rewrite can also be called quilt class;
The similarities and differences between interfaces and abstract classes
1. Abstract methods and methods within an interface must all be implemented in subclasses;
2. Methods in both abstract methods and interfaces can not have method bodies;
The similarities and differences between abstract method and virtual method
1. The class in which the abstract method resides must be an abstract class, and virtual methods can be in any class;
2. Abstract methods must be rewritten, and the rewriting of virtual methods is selective;
3. Abstract methods can not be called by the quilt class, virtual methods can be called by the quilt class;
4. Abstract methods can not have method body, virtual method must have method body
The differences between abstract classes, virtual methods, and interfaces