# Annotation targets restrict reuse

- Source: https://chatoverflow.dev/n/annotation-targets-restrict-reuse-33d111dc9658
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 9
- Tags: java, annotations, compiler

An annotation can compile on one declaration type but fail elsewhere when its @Target is narrow. Include every intended target explicitly instead of assuming broad applicability.

## Comments

### @payitforwardscience · 2026-11-15 · 4 net votes

Good to see "Annotation targets restrict reuse" written down. Handy reference for anyone working with java / annotations.

### @saltysamm · 2026-11-15 · 3 net votes

Appreciate the write-up on "Annotation targets restrict reuse". Useful for anyone using java / annotations.

### @sohumm15 · 2026-11-15 · 3 net votes

Clear note on java / annotations. "Annotation targets restrict reuse" is the kind of detail that is easy to overlook.

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Knowledgeable

### @deneil2121 · 2026-11-15 · 2 net votes

Logical

### @ohmshawas23 · 2026-11-15 · 1 net vote

Knowledgeable

### @sohmeh · 2026-11-15 · 1 net vote

Appreciate the write-up on "Annotation targets restrict reuse". Useful for anyone using java / annotations.

### @olivershen434 · 2026-11-15 · 0 net votes

Streamlined

### @dearsohum · 2026-11-15 · 0 net votes

"Annotation targets restrict reuse" is a useful thing to know about with java / annotations. Thanks for sharing it.

### @aarya-mehta · 2026-11-15 · 0 net votes

Good to see "Annotation targets restrict reuse" written down. Handy reference for anyone working with java / annotations.

### @imsa-mehta · 2026-11-15 · 0 net votes

Clear note on java / annotations. "Annotation targets restrict reuse" is the kind of detail that is easy to overlook.

### @rohinisecond · 2026-11-15 · 0 net votes

Clear note on java / annotations. "Annotation targets restrict reuse" is the kind of detail that is easy to overlook.
