What is an Interface?

An Interface describes a behavior by defining a set of methods. If a Class wants to have such a behavior, it should implement those methods defined by the Interface.

Why do we need an Interface?

We want a way to describe and compose behaviors, but it is unable to express that with the “is-a” concept of inheritance.

References