Some examples that show how Abstract Classes and Interfaces work in Java. I learned this on Edureka.
An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.
An interface is a reference type in Java. It is similar to class. It is a collection of abstract methods. A class implements an interface (or extends another class), thereby inheriting the abstract methods of the interface.
Interfaces can only extend other interfaces.
The Abstract class and Interface both are used to have abstraction. An abstract class contains an abstract keyword on the declaration whereas an Interface is a sketch that is used to implement a class.