The @Override annotation.

Figure 485. Overriding Object.toString() Slide presentation Create comment in forum
public class Shape {

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

Figure 486. @Override: Easy compile time error detection Slide presentation Create comment in forum
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().