Java Annotation - Built-In Annotations

Built-In Annotations

Java defines a set of annotations that are built into the language.

Annotations applied to java code:

  • @Override - Checks that the function is an override. Causes a compile warning if the function is not found in one of the parent classes.
  • @Deprecated - Marks the function as obsolete. Causes a compile warning if the function is used.
  • @SuppressWarnings - Instructs the compiler to suppress the compile time warnings specified in the annotation parameters

Annotations applied to other annotations:

  • @Retention - Specifies how the marked annotation is stored—Whether in code only, compiled into the class, or available at runtime through reflection.
  • @Documented - Marks another annotation for inclusion in the documentation.
  • @Target - Marks another annotation to restrict what kind of java elements the annotation may be applied to
  • @Inherited - Marks another annotation to be inherited to subclasses of annotated class (by default annotations are not inherited to subclasses).

Read more about this topic:  Java Annotation

Famous quotes containing the word built-in:

    Because there is very little honor left in American life, there is a certain built-in tendency to destroy masculinity in American men.
    Norman Mailer (b. 1923)