Should a method that implements an interface method be annotated with `@Override`?
The [javadoc of the `Override` annotation][1] says:
> Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type but does not override a superclass method, compilers are required to generate an error message.
I don't think that an interface is technically a superclass. Or is it?
[Question Elaboration][2]
[1]: http://java.sun.com/javase/6/docs/api/java/lang/Override.html
[2]: https://stackoverflow.com/revisions/212614/5 wow this question could be shorter, but it's the question I needed. Thanks
以上就是Should we @Override an interface's method implementation?的详细内容,更多请关注web前端其它相关文章!