Reputation: 5867
I recently found that ( http://www.javabeat.net/articles/30-annotations-in-java-50-2.htmlthe )syntax of the @Override annotation is
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.RUNTIME)
public @interface Override
{
}
But I think the following.Since it can be applied only to methods and since it inform this to compiler.
@Retention(RetentionPolicy.CLASS
@Target(ElementType.METHOD)
public @interface Override
{
}
Please tell me which one is correct. Please explain, if i am wrong.
Thanks.
Upvotes: 0
Views: 435