This is a problem that beginners often encounter. Seeing this problem, they remember the painful learning process before. A brief answer. Is there a difference between an interface and an abstract class? To be sure, there is a difference. Now that there is a distinction, it is worth questioning why and for what purpose language designers design the distinction between interfaces and abstract classes. Programming language design is a philosophy. First, interfaces and abstract classes are designed for different purposes. Interfaces are abstractions, while abstract classes are abstractions from roots. For abstract classes, such as man and woman, we can design a higher-level abstract class for these two classes — people. For interfaces, we can eat sitting, we can eat standing, we can eat with chopsticks, we can eat with a fork, and we can even eat with hands like brother Three, so we can abstract these eating actions into an interface — eating. So in high-level languages (e.g. Java,c#), a class can only inherit from one abstract class (because you can’t be both living and abiotic). But a class can implement multiple interfaces simultaneously, such as drive, skate, slap, kick soccer, and swim. Neither an abstract class nor an interface can be instantiated directly. Instantiation of both classes involves polymorphism. See Java polymorphism for examples. If an abstract class is to be instantiated, the variables defined by the abstract class must point to a subclass object that inherits the abstract class and implements all of its abstract methods. If the interface is instantiated, the variable defined by the interface refers to a subclass object that implements all methods of the interface. Abstract classes are inherited by subclasses, and interfaces are implemented by subclasses. 3, the interface can only be declared on the method, abstract class can be declared on the method can be implemented. 4. All methods in an abstract class must be implemented by the subclass. If the subclass cannot implement all methods, the subclass must also be abstract. All methods in an interface must be implemented by a subclass. If the subclass cannot be implemented, the subclass must be an abstract class. 5. Methods in interfaces can only be declared, not implemented. This shows that interfaces are the result of design and abstract classes are the result of refactoring. 6. An abstract class can have no abstract methods. 7. If a class has abstract methods in it, the class must be abstract. 8. Methods in abstract classes are implemented, so abstract methods cannot be static or private. 9. Interfaces (classes) can inherit from interfaces, or even from multiple interfaces. But a class can only inherit from one class. Level of abstraction (from high to low) : Interface > Abstract Class > Implementation class. Abstract classes are mainly used to abstract classes, and interfaces are mainly used to abstract method functions. Use abstract classes when you are concerned with the essence of things; When you focus on an operation, use interfaces. 12. Abstract classes should be much more powerful than interfaces, but defining abstract classes is expensive. In a high-level language, a class can inherit only one parent class. That is, when you design the class, you must abstract out the properties and methods that all the subclasses of the class have in common. But classes (interfaces) can inherit from multiple interfaces, so you only need to abstract specific action methods to each interface. That is, interfaces are designed to be more extensible, while abstract classes must be carefully designed.