IntelliJ IDEA
 
Get IntelliJ IDEA

Annotations

Last modified: 06 January 2025

Annotations are pieces of metadata that provide information about code elements, such as classes, methods, or parameters.

Annotation general

In Java, there is a set of built-in annotations. Also, many libraries and frameworks, such as Spring and Lombok, define their own annotations. The metadata provided by these annotations can be used both at compile- and run-time, for example, to generate boilerplate code, or interact with the user classes through reflection.