Java annotations are supplements and metadata to the Java compiler, they can be added to classes, methods, fields, parameters, and packages. Although they do not affect the code execution, they can change the way a program is treated by the compiler, they can be an alternative to the Java marker interface. Annotations start with @

Built in annotation

AnnotationApplicationDescription
@OverrideMethodIndicates that a method is intended to override a method in a superclass
@DecprecatedMethod, class, fieldMarks a method, class, or field as deprecated, single that it should no longer be used
@SupressWarningsMethod, class, field, local variable, parameterInstructs the compiler to suppress specific warnings (e.g. unchecked warnings)
@SafeVarArgsFinal, static, prive methodSuppresses unchecked warnings in a method or constructor with a variable number of arguments

Custom annotation

You can create your own annotations by using the @interface keyword.