Skip to content

Commit c9fa3ad

Browse files
Annotation Elements: Clarify that annotation elements can be other annotations (#118)
Co-authored-by: Ethan McCue <[email protected]>
1 parent 44eafe0 commit c9fa3ad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/annotations/elements.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,20 @@ The method should take no arguments.
2020
}
2121
```
2222

23-
And the return value needs to be one of a few built-in types like `Class`, `String`, `int`, `boolean`, etc.[^fulllist], an `enum`, or an array of one of those.
23+
And the return value needs to be one of a few built-in types like `Class`, `String`, `int`, `boolean`, etc.[^fulllist], an `enum`, another annotation interface, or an array of one of those.
2424

2525
```java,no_run,does_not_compile
2626
enum Priority {
2727
HIGH,
2828
LOW
2929
}
3030
31+
@interface Deadline {
32+
int year();
33+
int month();
34+
int day();
35+
}
36+
3137
class PersonInCharge {}
3238
3339
@interface Todo {
@@ -49,7 +55,10 @@ class PersonInCharge {}
4955
// Enums ✅
5056
Priority priority();
5157
52-
// Other Classes ❌
58+
// Other annotations ✅
59+
Deadline deadline();
60+
61+
// Other classes ❌
5362
PersonInCharge personInCharge();
5463
}
5564
```

0 commit comments

Comments
 (0)