How does the @Override annotation work in java?

I understand that the @Override annotation in java simply tells the compiler to check and verify whether it really cancels the method in the superclass at compile time.

From an article I read: https://dzone.com/articles/how-annotations-work-java .

@ Defining an annotation definition is simple:

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
public @interface Override {
}

There is no logic in this definition of annotation telling the compiler to look for the same method signature in the superclass.

Is logic checking a superclass for the same method signature in a java compiler?

+4
source share
1 answer

. @Override, , . , , . . .

+2

Source: https://habr.com/ru/post/1683912/


All Articles