Pages

Annotations

JSTL
✓ Definition

Java Annotations allow us to add metadata information into our source code, although they are not a part of the program itself. Annotations were added to the java from JDK 5. Annotation has no direct effect on the operation of the code they annotate.


✓ Java Custom Annotations

User Defined Annotations can be used to annotate program elements, that is variables, constructors, methods. These annotations can be applied just before the declaration of an element.

✓ Types Of Built-In Annotation
Predefined Annotations
  1. @Deprecated
  2. @Override
  3. @SuppressWarnings
  4. @SafeVarargs
  5. @FunctionalInterface
Meta Annotations
  1. @Retention
  2. @Documented
  3. @Target
  4. @Repeatable
  5. @Inherited