1, the difference between abstract class and interface:
(1) An abstract class is a class that has only variables or method declarations, and these variables (attributes) and methods are abstract types. There is no implementation of the method for the abstract class.
(2) An interface is a method declaration only. Without the implementation of a method, the method of an interface is also an abstract method, unlike an abstract class: an interface can only define static final member variables.
2, abstract class and interface in common:
The method implementations of an abstract class and an interface are implemented in an inherited (subclass) or class that implements an interface.
2. The difference between an abstract class and a parent class:
(1) The abstract class differs from the parent class in that the abstract class can only declare a property or method and cannot implement it. The subclass that inherits this class must implement all methods of the abstract class.
(2) The parent class is also the declaration and implementation of properties and methods, and cannot be defined without implementation.
This article is from the "Trials and hardships" blog, please be sure to keep this source http://carben.blog.51cto.com/8690350/1626612
The direct differences and connections between abstract classes, interfaces, and parent classes in Java