为什么Java中没有@Implements注解? [英] Why there is no @Implements annotation in Java?
本文介绍了为什么Java中没有@Implements注解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现 @Override
注释在覆盖派生类中的一些超类方法时非常有用.基本上编译器能及早发现我的程序中的缺陷,这总是一件好事.但是为什么Java中没有@Implements注解?
I have found the @Override
annotation very much helpful while overriding some super class methods in my derived classes. Basically the compiler detects the flaws in my program early which is always a good thing . But why there is no @Implements annotation in Java ?
推荐答案
因为您也将 @Override
用于接口定义的方法.
Because you use @Override
for methods defined by interfaces as well.
(是的,您是在实施"而不是覆盖"……但是 @Override
用于两者)
(Yes, you're "implementing" rather than "overriding" ... but @Override
is used for both)
这篇关于为什么Java中没有@Implements注解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文