Annotations are metadata tags that help define additional information to classes, interfaces, methods, or fields. Annotations don’t add extra implementation to the functional code. Although we can attach them to packages, classes, interfaces, methods, and fields, annotations by themselves have no effect on the execution of a program.
The built-in annotations such as @Override, @Deprecated, and @SuppressWarnings provide the interpreter, with the information related to the execution of code. For instance, @Override is used to instruct the interpreter that the annotated method is being overridden.
Annotations provide build-time/compile-time instructions to the interpreter that are used by software build tools for generating code. The compiler can use annotations to catch errors or suppress warnings. When someone looks at the code, annotations help make it readable and easy to understand. Annotations can be examined at runtime to run tests.