Should we @Override an interface's method implementation?

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏