You should always annotate methods with @Override
if it's available.
In JDK 5 this means overriding methods of superclasses, in JDK 6, and 7 it means overriding methods of superclasses, and implementing methods of interfaces. The reason, as mentioned previously, is it allows the compiler to catch errors where you think you are overriding (or implementing) a method, but are actually defining a new method (different signature).
The equals(Object)
vs. equals(YourObject)
example is a standard case in point, but the same argument can be made for interface implementations.
I'd imagine the reason it's not mandatory to annotate implementing methods of interfaces is that JDK 5 flagged this as a compile error. If JDK 6 made this annotation mandatory, it would break backwards compatibility.
I am not an Eclipse user, but in other IDEs (IntelliJ), the @Override
annotation is only added when implementing interface methods if the project is set as a JDK 6+ project. I would imagine that Eclipse is similar.
However, I would have preferred to see a different annotation for this usage, maybe an @Implements
annotation.