What is an Interface ?

An interface in java is a blueprint of a class. It defines what the class will do. The interface in java is a mechanism to achieve fully abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve fully abstraction and multiple inheritance in Java. An interface represents an IS-A relationship. A class can implement multiple interfaces which kind of provides a workaround for the multiple inheritance limitation in Java.
A simple example of an interface and its implementation is as follows.

interface Greeter{
void sayHello();
}
class OldMan implements Greeter{
@Override
public void sayHello() {
System.out.println("Hello Sir");
}
}
class Youngster implements Greeter{
@Override
public void sayHello() {
System.out.println("Wassup Dude");
}
}
In the above example the Greeter interface defines that the class will sayHello. How it will say hello can be decided by the class itself
CORE JAVA INTERFACE