Interfaces are blueprint like class, but it will have only the method declaration. It won’t have any method of implementation. All the methods in the interface are public abstract by default. Java 1.8 interface can have static and default methods.

Interfaces are mainly used in API’s.

For Example: Consider you are designing vehicles engine.

When you are done with the hardware part, you want some of the software functionalities to be implemented by a client who is using your engine. So, in that case, you can define your engine functionalities in an interface.

Interface Engine
{
void changeGear(int a);
void speedUp(int a);
}

Rules to be followed for Interface

The class which is implementing the interface should implement all the methods in the interface.