Why is there no @Implements annotation in Java?

I found the @Override annotation very useful, overriding some super class methods in my derived classes. Basically, the compiler detects flaws in my program, which is always good. But why is there no @Implements annotation in Java?

+8
java annotations
source share
4 answers

Because you are using @Override for methods defined by interfaces.

(Yes, you are "implementing", not "overriding" ... but @Override used for both)

+14
source share

With Java 6, you can use @Override for class methods that implement methods defined in interfaces

+2
source share

To implement the interface, we use implements , and if any method exists in this interface, we override these methods to ensure implementation.

Thus, there is only the @Override annotation, because in both cases (class or interface) we always override.

+1
source share

To implement an interface, a keyword already exists: implements . but there is no such keyword to override. @Override not a keyword, but works similarly.

0
source share

All Articles