JAVA basics - the difference between abstract classes and interfaces

1. Interfaces can inherit interfaces

2. Only methods can be defined in the interface, and the implementation process cannot be written

3. An abstract class does not have to implement all interface methods to implement an interface.

4. An abstract class inheriting an abstract class does not necessarily have to implement all the methods of the abstract class

5. Subclasses that implement an interface must implement all methods in the interface

6. Subclasses inheriting abstract classes must implement all unimplemented methods in the abstract class

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325685353&siteId=291194637