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?
howly source
share