What is interface?
Interface is a special type of class in java that has only abstract method. And the abstract method is a method that has only method declaration not implementation. An interface is act like a blueprint of a class.
To implement the abstract method we must have to override all the abstract method inside the implementer class otherwise we will get error.
Interface provides us a 100% abstraction because it contains only abstract method.
Interface does not contain constructor so the multiple inheritance is possible through an interface.
We can compile interface we can’t run.
All the method present inside the interface are implicitly public and abstract and all the variable are by default public static and final there is no instance variable are present inside the interface.
As we know the variable are public static and final so that we must have to initializes the variable the constant.
For example we create and bank interface which has some abstract method like credit and deposit. and we have two implementer class likes HDFC and SBI and for implementing those logic inside the SBI and HDFC we must have to override all the abstract method and if we not override those method inside the implementer the compiler will throw an error.