Exercise – Interface versus abstract class
What is the difference between an interface and an abstract class? We did not talk about it, so you will need to do some research.
Note
After the default methods of interfaces were introduced in Java 8, the difference shrunk significantly, and is negligible in many cases.
Answer
An abstract class can have a constructor, while an interface cannot.
An abstract class can have a state, while an interface cannot. The fields of an abstract class can be private and protected, while in an interface, fields are public, static, and final.
An abstract class can have method implementation with any access modifiers, while implemented default methods in an interface are public only.
If the class you would like to amend extends to another class already, you cannot use an abstract class, but you can implement an interface, because a class can extend to only one other class but can implement multiple interfaces.