EMZETT.
Login

@Override

In short: @Override is an annotation in Java that shows a method overrides an inherited method.

In more detail: The compiler checks whether the method really exists in the superclass. Typos in the name are noticed immediately.

In Depth

@Override
public String toString() { return "Dog " + name; }

For interfaces too, you use @Override for implemented methods. See override, extends.

See also: Override, extends, Interface