The @Override annotation.

Figure 487. 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 488. @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().