---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 19 Edition"
java_version: 19
chapter: "Chapter 9. Interfaces"
section: "9.7"
heading: "9.7. Annotations"
parent: "Chapter 9. Interfaces"
source: https://docs.oracle.com/javase/specs/jls/se19/html/jls-9.html#jls-9.7
id: "9.7"
url: https://jvm.obfuscated.software/jls/se19/9.7.html
raw: https://jvm.obfuscated.software/jls/se19/9.7.md
---

# 9.7. Annotations

An *annotation* is a marker which associates information with a program element, but has no effect at run time. An annotation denotes a specific instance of an annotation interface ([§9.6](9.6.md)) and usually provides values for the elements of that interface.

There are three kinds of annotations. The first kind is the most general, while the other kinds are merely shorthands for the first kind.

```
Annotation:
  NormalAnnotation
  MarkerAnnotation
  SingleElementAnnotation
```

Normal annotations are described in [§9.7.1](9.7.1.md), marker annotations in [§9.7.2](9.7.2.md), and single element annotations in [§9.7.3](9.7.3.md). Annotations may appear at various syntactic locations in a program, as described in [§9.7.4](9.7.4.md). The number of annotations of the same interface that may appear at a location is determined by the interface declaration, as described in [§9.7.5](9.7.5.md).

**Sections:**

- [9.7.1. Normal Annotations](9.7.1.md)
- [9.7.2. Marker Annotations](9.7.2.md)
- [9.7.3. Single-Element Annotations](9.7.3.md)
- [9.7.4. Where Annotations May Appear](9.7.4.md)
- [9.7.5. Multiple Annotations of the Same Interface](9.7.5.md)
