Java Interface

Java Interface

A Java interface declares methods that classes are expected to implement. It
encapsulates a set of associated behaviors that can be used by dissimilar classes.
Interfaces contain no instance fields and cannot be instantiated.

A class realizes (implements) an interface by promising to provide the implementation for all of the methods in the interface. An interface can be implemented by many classes and a class can implement multiple interfaces. All methods in an interface are automatically public and abstract.