What is the difference between an abstract class and an interface in Java?
Point
Abstract class
Interface
Inheritance
A class extends only one
A class implements many
Fields
Any kind of fields
Only constants (public static final)
Constructors
Yes
No
Methods
Abstract and normal
Abstract, default, static and private
Use when
Related classes share code and state
Different classes share a behavior
A good rule: use an interface to say what something can do, and an abstract class to share code between closely related classes. See Abstract Classes and Interfaces.