The @Override annotation.

Figure 497. Overriding Object.toString() Slide presentation
public class Shape {

  double x, y;
 ...
  @Override  // Promise: Subsequent method overrides Object.toString();
  public String toString() {
    return "(" + x + "|" + y + ")";
  }
}

Figure 498. @Override: Easy compile time error detection Slide presentation
public class Shape {

  double x, y;
 ...
  @Override  // Error: method does not override a method from a supertype
  public String toString(int value) {
    return "(" + x + "|" + y + ")";
  }
}

Explanation: The given method does not override Object.toString().