Annotations are primarily used by code that is inspecting other code. They are often used for modifying (i.e. decorating or wrapping) existing classes at run-time to change their behavior. Frameworks such as JUnit and Hibernate use annotations to minimize the amount of code you need to write yourself to use the frameworks.
Oracle has a good explanation of the concept and its meaning in Java on their site.
Related Contents:
- When do you use Java’s @Override annotation and why?
- Scanning Java annotations at runtime
- Difference between and
- Where does the @Transactional annotation belong?
- Spring: @Component versus @Bean
- Hibernate Annotations – Which is better, field or property access?
- Do I need elements in persistence.xml?
- Difference between @Before, @BeforeClass, @BeforeEach and @BeforeAll
- Why java classes do not inherit annotations from implemented interfaces?
- Why does JPA have a @Transient annotation?
- Is it possible to read the value of a annotation in java?
- Emulate annotation inheritance for interfaces and methods with AspectJ
- Java Annotations values provided in dynamic manner
- How to annotate MYSQL autoincrement field with JPA annotations
- What is the use of marker interfaces in Java?
- How to inject a Map using the @Value Spring Annotation?
- JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object
- JFreechart series tool tip above shape annotation
- Why does Eclipse complain about @Override on interface methods?
- How does lombok work?
- hibernate column name issues
- Why is javac failing on @Override annotation
- Hibernate : How override an attribute from mapped super class
- How to configure MappingJacksonHttpMessageConverter while using spring annotation-based configuration?
- Adding Java Annotations at Runtime
- How and where are Annotations used in Java?
- What is the purpose of @NamedArg annotation in javaFX 8?
- Get rid of “The value for annotation attribute must be a constant expression” message [duplicate]
- Which annotation should I use: @IdClass or @EmbeddedId
- can someone please explain me @MapsId in hibernate?
- annotation to make a private method public only for test classes [duplicate]
- @Nullable annotation usage
- @Transactional(propagation=Propagation.REQUIRED)
- Annotations from javax.validation.constraints not working
- Retrieve Java Annotation Attribute
- How to get annotations of a member variable?
- How can I reload properties file in Spring 4 using annotations?
- How to scan multiple paths using the @ComponentScan annotation?
- How to supply Enum value to an annotation from a Constant in Java
- Annotating the functional interface of a Lambda Expression
- Inherited abstract class with JPA (+Hibernate)
- how to make a composite primary key (java persistence annotation)
- How do annotations like @Override work internally in Java?
- Error setting a default null value for an annotation’s field
- Jackson – Required property?
- Multiple annotations of the same type on one element?
- org.hibernate.MappingException: Could not determine type for: java.util.Set [duplicate]
- How to use an array constant in an annotation
- Java Getters and Setters
- Create Annotation instance with defaults, in Java