Interfaces

Let's learn about an important topic of Java abstraction i.e. interfaces.

What is an interface?

An interface is just like a class and specifies the behavior that a class must implement.

An interface can be used to achieve 100% abstraction as it contains the method signatures/abstract methods(what to be done) and no implementation details (how to be done) of these methods. In this way, interfaces satisfy the definition of abstraction. The implementation techniques of the methods declared in an interface are totally up to to the classes implementing that interface.

An interface can be thought of as a contract ...