@Override is an java annotation.
Indicates that a method declaration is intended to override a method declaration in a superclass. If a method is annotated with this annotation type but does not override a superclass method, compilers are required to generate an error message.
Also See
- when-do-you-use-javas-override-annotation-and-why
Example:
class Parent{
public void foo(){
}
}
class Child extends Parent{
//compile perfect !
@Override
public void foo(){
}
//will show compile time error message here as it is not being overridden
@Override
public void foo(int i){
}
}