Worked example
interface Shape {
double area(); // no body — just the signature
String name();
}
class Circle implements Shape {
private double r;
public Circle(double r) { this.r = r; }
public double area() { return 3.14 * r * r; } // must provide
public String name() { return "Circle"; } // must provide
}
If Circle left out either method, it would not compile — the contract is not fulfilled.