Synopsis: | Use @Override annotation if applicable |
Language: | Java |
Severity Level: | 4 |
Category: | Basic |
Description: |
Annotating overridden methods with @Override ensures at compile time that the method really overrides one, which helps refactoring and clarifies intent. public class Foo implements Runnable { // This method is overridden, and should have an @Override annotation public void run() { } } |