The @Override annotation.

Figure 422. 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 423. Failure: Not overriding Object.toString() 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 + ")";
  }
}